WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Turn a Page into a Post ?? (6 posts)

  1. pawsingleton
    Member
    Posted 5 years ago #

    Any ideas on how I might easily turn a page into a post?

  2. desertwebdesigns
    Member
    Posted 5 years ago #

    Needs to be done through the database. Go to the Edit Pages screen and hover over/click on the page you want to change. You should have a link that looks like this:

    http://www.domain.com/wp-admin/page.php?action=edit&post=170

    You need that number

    Log into your phpMyAdmin or MySQL interface, and execute this command:

    UPDATE wp_posts SET post_type='post' WHERE ID=<strong>170</strong>

    This is assuming that your WordPress database prefix is wp. If it isn't, change wp_posts in the above code to whatever your posts table is named: (eg. my_posts, db_posts, really_long_prefix_posts, etc)

    Now go to your Edit Posts page and you will see your page there. Change other post settings as necessary, but that will switch it over.

  3. desertwebdesigns
    Member
    Posted 5 years ago #

    OK, so bold text doesn't work inside of code, lol.

    UPDATE wp_posts SET post_type='post' WHERE ID=170

    You get the point. Insert that ID from the link into the code.

  4. pawsingleton
    Member
    Posted 5 years ago #

    That is an awesome answer, I wish I understood it more fully (newby). I'll work with it and see what I can do, trying to change 30 pages.

  5. desertwebdesigns
    Member
    Posted 5 years ago #

    SQL is a pretty simple language to understand. The above statement basically means

    UPDATE <table_name> SET <what_to_change> WHERE <change_criteria>

    So we're updating the wp_posts table. We're setting the value of post_type in that table to 'post' (it is currently 'page'). And we're making that change for the post record identified with an ID of 170 (or whatever your post ID is).

    Each record in that table is equivalent to a post of some type in your website, be it a post, page, revision, attachment, etc. We want to change from page to post. All records are identified by an incrementing ID number. That's how we specify which record to update (you can update multiple records at a time). We found the ID from the URLs.

    That's how we come up with our UPDATE statement. Pretty simple once you know how.

    FYI: If you left off the WHERE statement at the end, you are no longer filtering for certain records, and you would update EVERY record in that table. This is not good. It would mean that all the revisions in there (auto-saves) just became live posts :) Type carefully. Little mistakes can cause big problems

  6. Yofazza
    Member
    Posted 4 years ago #

    Hello,

    Are you sure this is safe for the latest WordPress (2.8.4)?

    I tried it and there seems to be no problem. Forgive me but I just want to be sure. :D

    And if we want to convert Post into Page, is it safe to just set the Post into "uncategorized" and change the post_type value to 'page'?

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic