I have been using WordPress since version 1.x and back then there was no native support for tags in WordPress. Easiest thing to add tags to post was to use UTW or other plugins and because of my new found love for tags then, I started using WP-Tagerati and then moved on to Ultimate Tag Warrior. Using these plug-ins meant adding custom tags such as
into each post. The plug-ins would parse the post for these custom tags and then tags could be displayed using some APIs provided by the plug-in.
Since v2.3, wordpress now comes with built in support for Tags. This has eliminated the need for using the above mentioned plugins. So, I decided to get rid of them. On disabling the plugins, I noticed that the custom tags along with the tagging information were appearing as post content. To fix this issue, I initially started using Embedded Tag Thing but finally decided to get rid of the tagging information from the posts altogether. Before you do get rid of the tags, do make sure that you import them into wordpress’s tag data, so that you don’t loose this information totally.
Considering that you have a standard installation of WP, fixing this problem is a breeze if you don’t mind playing a bit with phpMyAdmin. Just do the following:
0. Backup WordPress
Backup you WP database. Always, backup your database before going in for direct manipulation of WP data. You can get a whole lot of information by reading about it here.
1. Download Posts table using phpMyAdmin
Go to the phpMyAdmin URL for you WP installation’s database. You can do this by using the very useful WP-phpMyAdmin plugin. As shown in the following screenshot, select the wordpress database that you have configured from the dropdown menu. And then select the wp_posts table. This will refresh the frame on the right side to display the wp_posts table.
Now, we are going to export the posts table. To do this, select the Export tab –> check the Add DROP TABLE checkbox –> hit Go. See the screenshot below.
This will take you to a page that contains a textbox with an SQL script in it. Copy the contents of the textbox and save them in a file.
2. Edit the file
Open the file in your favorite editor. You will see the SQL Dump that contains a lot of queries. Now, run a regex replace query on the content using the regex
This should go though you posts and remove all strings of the type [tags]foobar[/tags]. Change the regex to suit the way you have declared tags in your posts.
3. Import the file contents into wp_posts table
Go to phpMyAdmin and click on the import tab. See the screenshot for reference. Browse to the path where the modified file is located and just hit Go.
This should upload the file contents and execute the SQL queries in the file. If it fails and you see an error complaining about SQL_MODE being set to NO_AUTO_VALUE_ON_ZERO, just add a “--” in front of the statement
to comment it out and then try to upload the file again. If things work out fine, you will see a message that says something like “X queries were successfully executed“.
There you go, you are done, If you check the posts contents now, you will not see the tags information. And no need to use any plugins to explicitly manage these tags anymore. Though I do suggest using Simple Tags to gain more control over your tag management.