Changing WordPress Posts to Pages

Posted on April 17, 2008 | Filed Under WordPress

During the time that I was having problems with the spam injection hijack, I upgraded through a couple of versions of WordPress.  During this process, I somehow “lost” all my pages.  They were still there as posts, but for some reason they were not being seen as pages.

I did some searching on the issue, but really came up empty on finding an existing discussion of what I was looking for.  So, I did what I usually do when confronted with a WordPress issue that I can’t find a ready fix for – lift the hood and get my hands dirty figuring it out.

It didn’t take long for me to figure out the quick solution.  In the WordPress database there is a table called _posts (it will look like wp_posts or whatever your table prefix is).  In _posts, there is a field called post_type.  This can be set to either “page” or “post”.

In my case, the pages had been changed to post.  So I merely had to change the value of this field.  To do this, you could use something like phpMyAdmin or some other tool.  It helps to know the ID number of the original, but if you don’t know this, you can find it by browsing through the content of wp_posts.

Once you have changed the value of the post_type field to “page”, that post will show up as a page on your blog.

Site Update

Posted on April 16, 2008 | Filed Under WordPress

Once again, I thank everyone for their patience.  I believe that I have finally solved the problems with the site, but there is now much work to be done.

First, the issue I was having does not seem to be isolated.  It was a spam injection hijack of my blog, and to be honest, the only reason I noticed it was the content of the AdSense ads that were showing up.  It really was a bear to get rid of.  I will have a single post later that covers this because the problem appears to be effecting a lot of WP blogs.

That brings me to another important issue.  While I was infected via an exploit, some people that have gotten this hijack have actually installed it themselves.  They did this by downloading a theme or plugin from a site other than WP or the actual developer.  In the case of themes, they downloaded from a gallery where the download had actually been modified and contained javascript to run the hijack.  Lesson: only download from the original developer or where from a trusted source (i.e. WP). 

In the case of my plugins, I know that there are some sites that have downloaded from here and then helped themselves (w/o permission) to hosting it on their site.  I generally don’t waste my time going after these guys because the plugins are opensource and I have too much else to worry about.  But if you download from one of these, you could run into problems.  Here are some reasons to only download my plugins from “official” locations:

The only “official” location for my plugins are:

My plan is eventually to have everything as part of the WP site using SVN.

Back to the greater point of my post.  From here, I need to get the forum fixed and restore some of my content that was messed up during the recovery from the hijack.  Then I will be systematically going through and addressing comments that were questions on support issues.  If relevant, these will be moved into the forum (where support questions should be addressed).

If I can make it through all of that maintenance, then maybe we will get back on track with development of the existing plugins and new ones that have been on the back burner.  Also, the existing work I have needs to be tested in WP 2.5, but I see no reason why it wouldn’t be compatible at this point.

That’s all for now.  Again, thanks for your patience and support.