Wordpress

Wordpress 2.1 and the Disappearing Pages

After several Wordpress upgrades gone awry, I’ve learned by now that I should block out a couple hours whenever I decide to upgrade this blog. Never was that more true than in my latest upgrade attempt to Wordpress 2.1. After successfully running through the standard upgrade process I peeked at the main page with fingers crossed. Everything appeared to be working at first, but I was quickly surprised to find that all of my pages had disappeared!

When I navigated to Manage > Pages in the Wordpress Dashboard, I was confronted with the startling sight of a complete lack of pages. I was fairly concerned about this because I have around forty pages alone for the archives of my newspaper columns. I then jumped over to the Manage > Posts section and noticed that all of my pages were under the mistaken impression that they were actually posts. This is bad for obvious reasons. By showing up as posts, all of my pages no longer followed their absolute URL’s and it pretty much made a mess of the blog.

The new “post_type” fieldAfter a bit of research, I learned that the WP folks actually changed the way that pages and posts are differentiated in the database. You can find a thorough description of the change over at Playing with Wordpress. Basically, they’re making use of a previously empty field in the wp_posts table called post_type wherein posts are designated as “posts” and pages as “pages”. It’s a simple change, and I’m honestly not surprised they didn’t make the switch earlier, but it could pose a problem if your posts for some reason didn’t take up their proper type. After some quick browsing of my database tables, I realized this was exactly what went wrong with my upgrade.

For some reason, my post_type fields were all showing up as post”, and this made all of my old pages show up as posts in turn. I searched in vain for a simple fix for this, but in the end I just went into the db tables and manually changed my pages to “page”. Luckily I was able to batch edit several rows very quickly, so this didn’t end up taking too much time. I don’t usually spend too much time dealing with MySQL tables, so this was also a good refresher for myself.

If you come across the same issue on your blog, all you need to do is get access to your MySQL database and make the same changes manually. After making these edits, I’m now able to see all of my old pages in their correct locations and under Manage > Pages.

If anyone has any idea why my post_type fields weren’t filled correctly after the upgrade, I would be interested to know. Also, if you have a quicker fix to this issue, I’d be mighty interested as well.


Similar Posts

Trackbacks

blog comments powered by Disqus