Support » Fixing WordPress » Can't find custom posts after switching themes

  • So I recently switched themes, and the old theme had a custom post type called “Portfolio.”
    When I switched over themes the posts dissappeared, which wasn’t a big deal because I can just re-make them. The problem, however, is that when I tried to remake the posts with the same permalink, it’s already taken! (the permalink just redirects to a 404-page not found).
    Any idea where I can either find these custom posts and restore them as normal posts, or simply free up the permalink that was assigned to those old posts? I can’t find them in my trash anywhere…
    Any help is greatly appreciated!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Have you tried switching back to the old theme to see if the posts reappear? If they do, you can then use something like this plugin to convert the “portfolio” posts to another post type:

    Then you should be able to switch to your new theme and still access those posts.

    The Portfolio post type would have been registered in the functions.php of your old theme.

    In your new theme, register the post type again. If it’s saying it’s already taken, unregister the post type first.

    add_action( 'init', 'portfolio' );
    function portfolio() {
    	remove_action('init', 'portfolio');

    Doing this might bring in the old posts or not. I would think it would as they’ll still be in the database and should be assigned to the Portfolio post type.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can't find custom posts after switching themes’ is closed to new replies.