Home Forums Backend Issues (wp-admin) Duplicate CPT error when modifying slug name


Duplicate CPT error when modifying slug name

  • Hi there,

    I created a new CPT, configured it, got the front-end template working fine. Then my customer wanted to change the name of the CPT which I thought would be easy enough, but sadly it has not broken the CPT and there are 2 now visible.

    So the old slug was called services. The new one is called treatments and there are 2 appearing in the front-end menu. So how do I reduce this to 1 and how do I get the single.treatments.php template to show it?


  • PS, I have activated a child theme and put the template file there also.

  • Right, I have managed to delete the old CPT and get the new one working. However, the old CPT is still appearing as a ghost in the menu and it has a typo which may be the original cause of the problem. I have tried removing it with a flush of the rewrite rules table, but that did not work.

    I have attached the references from phpmyadmin below. Any idea what to do without knackering the DB?

  • This is really general WP. The problem is that when you remove a CPT that it does not delete the posts associated with it. Before renaming or removing a CPT you need to first delete all the posts that are associated with it if you want to remove them from the database. This is really the only way to delete them and all of their associated data, custom fields, revision, and whatever else WP stores about them.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Duplicate CPT error when modifying slug name’ is closed to new replies.