Removing tags from Wordpress posts content
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
<tags>foo, bar</tags>
or
[tags]foobar[/tags]
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
\[tags\].+?\[/tags\]
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
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
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.
VMware Player and Ubuntu 8.10 keyboard mapping issues
Posted by Nalin in Linux/Unix on November 12th, 2008
Yesterday I installed VMware Workstation 6.5 on my fresh install of Ubuntu 8.10. After powering on a Windows XP vm, I realized that I could not use the arrow keys properly. On hitting the left arrow key, start menu was being displayed and other arrow keys had similar issues. Also, using VMware player was completely impossible as ctrl-alt-del wasn’t working.
After searching around a bit I found that many others had faced similar issue. Apparently it is not a bug with VMware Workstation. Due to some updates to Ubuntu 8.10, the keyboard mappings were screwed up. I found good amount of information in the VMware communities forum.
To fix this issue, you simply need to run the following command,
echo 'xkeymap.nokeycodeMap = true' > ~/.vmware/config
and if VMware Player/Server/Workstation was running, just restart it.
You should then be good to go…
Static IP address on Ubuntu 8.10
Posted by Nalin in Linux/Unix on November 8th, 2008
Last Friday I upgraded my install from Ubuntu 7.04 to 8.10 Intrepid Ibex on my office workstation and I noticed that I was unable to assign static IP to the machine. After reboot the netmask was getting messed up and reset to 22. Look at this bug for more info.
So, I ditched the native ubuntu Network Manager and installed wicd which is another open source network manager that works with Ubuntu. But after configuring wicd with the static IP, I had another problem. Everytime I restarted the machine, I had to manually start the wicd network manager. Instead of trying anything more with wicd, I decided to ditch a network manager altogether and just configure the files myself.
So, to get the network working with static IP, first remove the network manager (Many people have said that it is not necessary, but I prefer to remove it as I wont be using it anyway):
sudo apt-get remove --purge network-manager
Then modify the /etc/resolv.conf with the dns servers and domain names:
search foo.bar.com bar.com
nameserver 192.168.0.1
nameserver 192.168.0.2
Now, modify /etc/network/interfaces and add
auto eth0
iface eth0 inet static
address 192.168.0.10
netmask 255.255.252.0
gateway 192.168.0.253
Now, just restart the networking:
sudo /etc/init.d/networking restart
Obviously, you should figure out the netmask, gateway and name servers before you start these steps.
This is all that you need to do to configure the machine with a static IP.
HemingwayEx 1.5 Final
I finally got myself to fix some more bugs and add a couple of new things into the HemingwayEx Wordpress theme. I received a few suggestions on features that could be added and after thinking about it a bit, I add some more things to this theme. This will (99.99%) be the last update of this theme coming out on my website. I have been intermittently updating this theme over the last year & a half and now I feel it’s time to move onto something else.
This update includes the following changes:
- A new CSS with Black, Blue and Gray colors.
- Added support for Paginating the homepage
- Added WP Gravatar API into the comments. You can turn it on/off using WP->Settings->Discussion page.
- Updated the theme to start using js included in WP itself.
- Removed support for Hemingway blocks. Now, this theme only works with Widgets.
- Fixed a few bugs reported by Thomas regarding the search page.
To get the theme go on over to the HemingwayEx download page.
It’s been a lot of fun working on this theme and I thank everyone who has used this theme and written to me about it.
VMware player on Ubuntu 8.04 (Hardy Heron)
Posted by Nalin in Linux/Unix on May 5th, 2008
I recently upgraded my office computer from Gusty to Hardy and VMware player stopped working for me. I looked around a bit and found a nice step-by-step guide to get it up and running. Here are the steps:
- cd /usr/lib/vmware/modules/source
- cp vmmon.tar vmmon.tar.orig
- sudo tar xvf vmmon.tar
- cd vmmon-only/include/
- sudo vi vcpuset.h
- change line 74 from: #include “asm/bitops.h” to: #include “linux/bitops.h”
- rm vmmon.tar (return to the folder where you decompressed the tar file)
- sudo tar cvf vmmon.tar vmmon-only/
- sudo rm -rf vmmon-only/
- sudo vmware-config.pl
To save you some time, I have uploaded the fixed vmmon.tar, that you can use to replace the original with. Just untar the vmplayer package, download vmmon.tar and cp it to <vmplayer_installer_dir>/lib/modules/source/ and then start the installation process.
This same process should work for VMware Server and Workstation as well.
Long long time ago…
Man…. it’s been ages since I have had a look at my site. I have been just too busy with work and lazy the rest of the time. My last post was on July 29th…
Finally, I upgraded to WP 2.3.1 tonight. As you can see (or might see), I am using the default WP theme right now as HemingwayEx doesn’t work with this version. I have been getting a lot of emails from people regarding this theme and many ppl have been enthu enough to go ahead and fix the theme to work with 2.3 as well. Hopefully, I will find sometime this weekend and do some work on it and answer questions in the forum.
Currently, I am eagerly looking forward to Dec and Jan. Both are going to be very eventful months. I am leaving for a three week trip to India in December and have other things coming up in Jan. Other than that, life is going on as usual… busy as hell on weekdays and boring/sad on weekends…
peace…
Harry Potter and The Deathly Hallows
I finished reading this last night and it left me with mixed feelings. I was happy to have finally finished reading all the Harry Potter novels, but I didn’t really enjoy the last book much. I had figured that after all these years, at 17, Harry Potter would be closer to being a proper hero, not the usual messed up dude, who can’t survive without his friends help. I was expecting him to take more responsibility and see his buddies relying on him.
But, the story was good. There is a good and reasonable (?) explanation for everything that happens. It does get quite complicated during the end with the reasoning for how he survives or why elder wand belongs to him, but then again, this series stopped being children’s novel a long time ago. I was quite ready to see Harry die, but because I had seen Bedazzled, I thought this self-less act of offering himself to he-who-must-not-be-named, would eventually save him
.
One thing that I really liked was that Rowling inserted the last chapter with describing Harry’s life 19 years later. It just makes a lot of sense as this way, no one is going to expect her to write another Harry Potter 8. I just hope someone else doesn’t start writing about how Harry saves the world again at 45, which has been the case with Robert Ludlum’s character Jason Bourne.
In the end, I have loved reading Harry Potter novels more than anything else I have ever read.
Powered by ScribeFire.
Multiple IE on your PC
Posted by Nalin in Applications, Windows on July 28th, 2007
Download: Multiple IE Installer
I have been getting quite a few complaints now that my Wordpress theme HemingwayEx is not working well with IE6. I had a standalone installation of IE6 that would crash every time I tried opening the slidebar on my theme and I thought that it was just a bug in IE6.
But apparently it is not. I thought of looking for another IE6 installer that would allow me to have IE6 and IE7 running at the same time. I came across Multiple IE Installer, that allows one to install any IE 3.0, 4.01, 5.01, 5.5 and 6. I used it to install IE 5.5 and IE6 after I had installed IE7.
So, now I can see that my theme doesn’t support IE5.5 at all, IE6 crashes because of a java script and IE7 doesn’t crash, but has other issues with the HemingwayEx Sildebar
. Well, now onto debugging the theme…
Powered by ScribeFire.



Azureus – Java BitTorrent Client
Get Firefox
Add to Google
Add to My Yahoo!
Recent Comments