Convert wordpress page to posts and vice versa

Sometimes we want to convert a wordpress page to post or vice versa. WordPress treats a post slightly differently. e.g. WordPress shows posts automatically in RSS feed and home page. Here are some ways to convert a page to post. Similar steps would apply to convert a post to page.

Convert page to post manually

You can always convert page to post by manually creating a new post and deleting the old page. This will not change the publishing date though. You can manually change that to old value.

Convert using plugin post type switcher

You can use wordpress plugin post type switcher to convert post to page (or vice versa) one at a time. Once the plugin is installed and activated, go to edit page admin ui. You should see Post Type value in publishing options as shown below:
post-type-switcher-admin-post-type-change-link Click on Edit link next to Post Type and change the Post Type to desired value as shown below:

What happens when you change Post Type in wordpress

WordPress uses wp_posts table to store both posts and pages. The column post_type decides the type of the post. When you change a post type to page the value of this column also changes accordingly.

Here is the results of query select distinct post_type from wp_posts

Share this article: share on Google+ share on facebook share on linkedin tweet this submit to reddit


Click here to write/view comments