qTranslate is a WordPress plugin intended for making the creation of multilingual content as easy as working with a single language. Great in concept but it causes nothing but grief when you try to part ways with the plugin.
It works by storing all of the translations together in the title and content fields of the database, separated by special text tokens. When you remove the plugin, it’s no longer there to intercept the_content() call and parse the text so you end up with all the translations being shown at once. To be honest, I cannot recommend this plugin until the storing of translations is separated from the main content.
It’s incredibly tedious to go through all of your posts removing the translations manually, so I have written a script to automate the process of removing all the translations except for the content in one languages that you wish to retain. You may freely use the script as you see fit. All I ask is that my disclaimer remain included. Should you feel so inclined as to give me a shout about changes and additions, even better :)
*Updated with MBString calls for multibyte character support
*Code is un-maintained, and only tested against QTranslate 2.5.32
- BACK UP YOUR DATABASE! WordPress has a lovely export tool.
- Configure the script. Open the script and set the variables at the top to point the script at the WordPress database as well as instruct it on which language you would like to retain. It’s well marked.
- You are about to delete all content translations but the content in the specified language.
- Run the script, via either Command Line or HTTP request.