Skip Navigation

[Resolved] Slug Problem For Hierarchical Custom Post Types

This thread is resolved. Here is a description of the problem and solution.

Problem:

When a custom post type is set as hierarchal it is not possible to upload media with the same slug.

Solution:

That is true for all posts and pages in WordPress.

Please avoid uploading images with the same name as the posts slug.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 3 replies, has 2 voices.

Last updated by fahimS-2 1 year, 11 months ago.

Assisted by: Christopher Amirian.

Author
Posts
#2547067
Screenshot_8.jpg

Tell us what you are trying to do?
First I uploaded an image on my website which has title 'pagescreen' and it's URL is '/pagescreen.jpg'. I created a custom post type called 'Product' and I kept it Hierarchical in the settings. Now I created a Product Post which has title 'pagescreen'. Now I can't set my new post url to 'mydomain.com/product/pagescreen'. It is automatically becoming 'mydomain.com/product/pagescreen-2'. If I visit to 'mydomain.com/product/pagescreen', the image 'pagescreen.jpg' appears.

If I don't keep the post hierarchical, everything works fine. But I want to keep the post hierarchical.

#2548259

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

I replicated the behavior on a clean installation and I am not sure if it is expected or not.

I reported this to second-tier support and will get back to you as soon as I have an answer.

Thank you.

#2549519

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

I have an answer from the second tier.

This is not related to Toolset and it is a main WordPress thing. Even if you deactivate Toolset altogether and test that for pages (which is default WordPress but it has that hierarchy option) you will see the same thing.

In general, please keep all the slugs unique and avoid uploading images with the same name of the page or custom post type slugs.

Thanks.

#2549669

My issue is resolved now. Thank you!