I changed a custom post_type to a different name. Now when I view a single page with the post_type I receive a 404 page.

How do I debug? Is there a WP log I can view the functions call?


Just try to update permalinks (i.e. Trigger a flush of the rewrite rules).

  • 1
    Reseting the permalinks from custom => default => custom fixed the issue. – Christopher Altman Oct 27 '10 at 14:52
  • Can you explain how to do this? – Scott Severance Apr 10 '14 at 21:24

Hi @Christopher Altman:

Long time, no talk! Hope you and the folks at Matter are doing well.

When you say you changed the name of the post type, I assume you mean you did so within your theme's functions.php file within your call to the register_post_type()? If so, did you also run a query in the wp_posts table to update the post_type field? If not you need to run the following query assuming your database prefix is 'wp_' and replacing 'new-type' with 'old-type' as appropriate (I'm assuming you are familiar with where and how to runn a SQL query?):

UPDATE wp_posts SET post_type='new-type' WHERE post_type='old-type'

Another situation is that you might be using the Redirection plugin? If so, try disabling it as it is known to cause these kind of problems.

If neither of these if your situation, please give more specifics such as how you defined your custom post type (did you use a plugin) and what steps you took to change? Also show some of the URL paths that are failing.

  • Hey Mike, good to hear from you again, and congratulations on the diamond next to your name. We are about to launch an awesome WP powered site with Google Maps integration. I went through the steps above. Although the post_types were updated the pages would not resolve. Finally, I figured out the answer (which I did not see in the documentation), you need to reset the permalinks. I use /%postname% for custom permalinks. I set permalinks back to the default, refreshed a page, then set permalinks to my custom configuration. That reset fixed my issue. Thank you for the insight. – Christopher Altman Oct 27 '10 at 14:49
  • @Christopher Altman - Ah yes, flushing permalinks. That's one of the things I've learned to do so much I often forget about it. Also, you might want to rethink using just /%postname%/ unless you will only ever have a tiny number of "Pages" (posts where post_type='page'), see: ottopress.com/2010/category-in-permalinks-considered-harmful – MikeSchinkel Oct 27 '10 at 20:14

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.