1

I'm running into an issue that must have something to do with an old custom post type which isn't used anymore in our new custom theme.

I can't recall what the old CPT was called but it causes an unwanted issue with new page url's resulting in mysite.com/service-2 URL's instead of mysite.com/service URL's.

There's no option to edit or to delete the old post anymore as the CPT isn't active anymore.

I already cleaned up the database but with no result. Is there some way to solve this or is exporting the current content into a fresh database the only option?

Update, it wasn't an als CPT post but must have been a page. Found the old page in the wp_post table and deleted that row. But don't ask my why that old page wasn't visible anymore in the wp-admin. Anyway, issue solved.

  • Are you sure the code that defines the old custom post type is removed from your install? It might be somewhere in a plugin, for instance. – cjbj Sep 16 '16 at 10:02
  • you can make a plugin which reactivate this custom post type just the time of definitively deleting all post – mmm Sep 16 '16 at 10:07
1

Found the old page in the wp_post table and deleted that row

0

First of all, make sure the post type declaration, wherever it was done, is removed from your website. If you did this with CPT, I would re-install the plugin and remove the custom post type from there. It could also be in your functions.php, for instance.

And secondly, visit the permalinks page. Simply visiting this page resets the URL rules in htaccess which "frees up" the URLs used by the custom post type.

  • I already flushed the permalink structure but with no result. The CPT was created without a plugin and must have been placed in the old function.php file of the old custom theme. I can't recall what it was named and the old post can't be edited in any way when visiting the URL unfortunately. – NielsPilon Sep 16 '16 at 11:22

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.