This tutorial shows you how to run a sql query on a specific database in phpMyAdmin.
This SQL Query changes the name of a custom post type from portfolio to photos which i tested in phpMyAdmin.
Once you login to phpMyAdmin:
- Select the database from the left hand sidebar you want to run the query in.
- Click SQL from the top menu
- Copy the following line of code from the view raw link in the Gist and paste it into the RUN query box.
- Make sure you change the names for each post type type to your own.
Note: Please take a full database export (backup) before running any SQL Queries.
And here’s an example of using the above query to change the name of CPT’s from portfolio to photos. ( Click Image To Enlarge ).
Change Custom Post Type Name
You’ll also need to change the name of your custom post type in the PHP code in your functions.php file from the old CPT name to the new one.
1 Minute Video
This video shows you what happens in the backend when you rename the single CPT’s from portfolio to photos and back again.
Was This Tutorial Helpful?