1

I have an instance of WordPress with multiple custom post types created with the CPT UI plugin.

The posts for one of the custom post types are shown on the front end as 404s. The other custom post types are fine.

I've tried flushing permalinks, deleting and remaking the post type, disabling all plugins, changing my theme.

I'm not entirely sure what else to check.

Thanks in advance for your suggestions,

Nathan

6
  • There has to be something wrong with your configuration can you post more info, maybe a screen capture of what you’ve set up? Mar 28, 2020 at 3:56
  • In the CPT UI plugin all of the settings are set to default except 'Has Archive' which is set to 'True'. I have three different post types created, Projects, Movies & Downloads. Downloads is the one that doesn't work. It used to work and then a few days ago someone told me one of my pages was a 404. I'm unsure what happened. If I create new post types they're fine. If I create new posts under this post type, they're 404s on the front end. If I delete and remake the post type, all the data is still there and they're still 404s (I know this is because it's saved through use of the plugin).
    – Nathan
    Apr 2, 2020 at 23:10
  • Do the REST API base slug and Post Type Slug match? (I don't even know if that makes a difference in this instance but lets check.) Apr 2, 2020 at 23:15
  • So the REST API base slug was empty (as per the default settings). I updated it to be the same as the post type slug. Flushed permalinks again, still no change. I changed the post type slug to Files instead of Downloads and all is good, but if I switch it back to Downloads then it says that slug already exists and the posts disappear on the front end again.
    – Nathan
    Apr 8, 2020 at 2:32
  • So there’s a conflict with another plugin or another post-type then. Are you using WooCommerce on the site? Apr 8, 2020 at 2:47

1 Answer 1

0

Based on our discussion in the comments I think the issue you're experiencing is that you've got a slug conflict with WooCommerce 'downloads'. Your CPT isn't conflicting but the slug it's applying is probably conflicting with WooCommerce's slug for downloads.

To rectify this, simply prefix your slug or adjust it:

/dls/

/nthn_downloads/

/themename_downloads/

Anything of that sort that'll differentiate it from the download endpoint & urls that WooCommerce generates for downloadable products should be sufficient.

Using the CPT UI plugin you would just edit your Post-Type and scroll down to the area pictured here...

Changing the post-type slug in the CPT UI plugin

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.