fbpx
change post type in wordpress

How to convert/change post type in WordPress

Are you looking for various ways to convert the post types on your site? We’ve got you covered. In this tutorial, we will show you how you can change the post type in WordPress.

Posts are one of the most significant elements of your website. They can be included in any type of site in the form of media, blog posts, products, attachments, and more. But sometimes you may need to change the post types. The good news is that in WordPress you can easily do so.

Why Convert Post Type in WordPress?

There are many post types that you can use for your website. The most common ones are posts, pages, and attachments. The attachments might include different types of media, files, and so on.

As your website grows, you might need to update some of your content which can result in changing the post type of some particular posts. Usually, this happens when you turn a popular post into a page because the content is highly engaging. For example, you may turn a post into a FAQ section.

Alternatively, you might also need to change the post types of particular posts if you want to modify or update your website as a whole. These situations don’t happen often but they may occur once in a while so it’s better to be prepared and have a basic idea of how to convert post types in WordPress when you need to.

How to Change Post Types in WordPress

You can change the post type in WordPress in 3 major ways:

  1. With a plugin
  2. Programmatically (using SQL Query)
  3. phpMyAdmin (single posts without SQL Queries)

Each method has its advantages and disadvantages. Let’s have a closer look at each of them so you can choose the most appropriate one for you.

1. Change Post Type with a plugin

Using a plugin is one of the easiest ways to change the post type in WordPress with a few clicks. There are several tools that you can use but for this demonstration, we will use Post Type Switcher. It is a free plugin that lets you change the post type of your pages and posts both individually and in bulk. You can also switch between a post, page, project, or product for the post types in your post.

post type switcher change post type in wordpress

1.1. Install and Activate the Plugin

To start using this plugin, you need to install and activate it first. In your WordPress dashboard, go to Plugins > Add New and search for the plugin. Then, click Install Now and after the installation is complete, activate it.

install plugin change post type in wordpress

You can also download and install it manually. If you’re not sure how to do it, check out our guide on how to install a WordPress plugin manually.

After the plugin is activated, you can change the post type of your posts.

1.2. Change Post Types in Single Post

To change the post type of single posts, go to the Posts tab. Here, there are two options to change the post type: via Quick Edit or by opening a post page. Let’s have a quick look at both.

1.2.1. Quick Edit

This is the quickest method to change the post type in WordPress using this plugin for a single post. In the Posts tab, search the post that you want to edit and click Quick Edit.

quick edit change post type in wordpress

You will be able to see a Post Type option. By default, it will be selected as Post, so if you want to change it, click on it and select the type you want. Finally, press Update to save the changes.

quick edit update change post type in wordpress

1.2.2. Post Page

Alternatively, you can also change the post type by opening an individual post page using this plugin. This is quite useful if you want to edit the content of the post as well as its post type.

To do this, go to the Posts tab in your WordPress dashboard, find the post you want to edit, and press Edit.

This will open the edit post page. Here, you can make all the necessary changes to the post and on the right sidebar, you will see a Post Type option. Simply select the post type you want with the help of the drop-down menu, and once you’re done, update the post.

That’s it!

For more information on how to use this plugin, check out our tutorial to turn a post into a page.

You can also use this method to change the post type of a new post. All you have to do is create a new post instead of editing an existing one and then change the post type from the right sidebar.

1.3. Change the Post Type in WordPress in Bulk

Another interesting alternative is to change the WordPress post type in bulk. To do this, go to the Posts tab and select the posts you want to edit with the checkboxes in front of the post titles. Then, click on the Bulk Action dropdown and select Edit. After that, press Apply and you will see the options to change several aspects of the posts you have selected.

One of those options is the Post Type. Simply click on the drop-down menu and select the post type that you want to set for the posts. Finally, press Update to apply the changes.

As you can see, changing the post type using a plugin is very easy. However, if you have coding skills, you can also do so programmatically.

2. Change Post Type in WordPress Programmatically (using SQL Query)

You can also change the post types in WordPress programmatically using SQL queries. Keep in mind that for this approach, you need to be the site owner or have access to the cPanel of your website to be able to add SQL queries.

As we’ll edit the information in the databases of your website, before we start, we highly recommend you backup your WordPress website and use a child theme. You can either create a child theme or use a child theme plugin. This way, you’ll be able to recover your site in case anything goes wrong.

Now without further ado, let’s move on with the process.

2.1. Login to cPanel and open phpMyAdmin

To change the post type in WordPress with SQL queries, first, log in to your cPanel. The credentials for your cPanel should be provided to you by the shared hosting you use on your site. To log in, you can go to the official site of cPanel, and then you will be redirected to your cPanel dashboard.

Under the Databases section, select the phpMyAdmin option.

cpanel phpmyadmin change post type in wordpress

2.2. Locate your Website Database and Enter SQL Query

Once in the phpMyAdmin dashboard, you will see different databases. Locate the particular database of your website and expand it to see all the data tables of your website.

Now go to the SQL tab, enter the following query and click Go.

UPDATE wp_posts SET post_type = 'post' WHERE post_type = 'page'

This will change the post types of every post from “post” to “page”

sql query change post type in wordpress

WordPress also has some other default post types that you can use for your posts:

  • Post (Post Type: ‘post’)
  • Page (Post Type: ‘page’)
  • Attachment (Post Type: ‘attachment’)
  • Revision (Post Type: ‘revision’)
  • Navigation menu (Post Type: ‘nav_menu_item’)

But what if you want to change the post type of certain posts instead of doing it in bulk. Let’s see how to do that in the next section.

3. Change Post Type of Single Posts using phpMyAdmin

You can also change the post type of a single post through phpMyAdmin without any code and SQL queries.

All you need to do is log in to your cPanel and open phpMyAdmin. Then, locate your database and open the posts table from phpMyAdmin. The post table is represented as ‘wp_posts’ by default.

Here you need to find the particular post that you want to edit using the post title or post ID. Once you find the post, press Edit.

After that, find the option to change the post type and enter the type you want to set. By default, it will be labeled as ‘post_type‘. You can enter the post type as a post, page, attachment, revision, or navigation menu just like the previous method with SQL queries.

Once you select the post type you want, click Go.

edit post type wp post change post type in wordpress

That’s it! Short and sweet!

For more information about this method, check out our guide on how to turn a post into a page.

Bonus: Customize the Post Types in WordPress

We have already shown you how to change the post type in WordPress, but you can also customize and rename the post types on your website using a plugin.

This can be beneficial if you want to represent the post types more specifically. For example, if you own a photography website, you might want to rename the post type “Posts” as just “Photos” since you will be posting photos as posts most of the time.

To do this, you can use the Custom Post Type Editor plugin to rename them and manage your website easier.

Install and Activate the Plugin

First, you need to install and activate the plugin. Go to Plugins > Add New in your WordPress dashboard and search for Custom Post Type Switcher. Click Install Now to install the plugin and then activate it once the installation is complete.

Edit the Post Types

Now go to Settings > Custom Post Types and you see all the registered custom post types and their status. They might vary depending on the themes and plugins that you are using. For this tutorial, we’ll use the Divi theme.

Find the post type you want to customize and press Edit. For this demo, we’ll edit the Posts.

All the available post type fields for the “Post” post type will be mentioned here. Simply change the name of the post type you want to change in the fields. For example, we have changed the “Post” “Photo” in this step, but you can change them to any post type that makes sense for your site. Once you’re happy with the changes, don’t forget to save the changes.

If after a while you change your mind and you want to revert all the changes you made for the post types, you can select the Reset all to their defaults option. This will automatically change all the post types with their default field names.

Note: This plugin has not been tested with the latest versions of WordPress at the release of this article. However, we’ve tested it and it works without any issues. Alternatively, you can use another plugin such as Custom Post Type UI.

Conclusion

Changing the post type can be beneficial to help you organize and customize your site. In this guide, we’ve seen three major ways to change the post type in WordPress:

  • With a plugin
  • Programmatically (SQL Query)
  • Via phpMyAdmin (single Posts without SQL Query)

The quickest method to change the post type is by using a plugin. Post Type Switcher is a free tool and lets you change individual post types as well as in bulk. If you don’t want to use a third-party tool, you can also change the post type programmatically. You can either use SQL queries to change them in bulk or just use phpMyAdmin to edit one post at a time.

Finally, we’ve seen how to rename and edit the post types to help you manage your website.

For more useful tutorials, have a look at the following articles:

Hello!

Click one of our representatives below to chat on Telegram or send us an email to [email protected]

How can I help you?