I'm just wondering if this is possible because the variation names listed in the products have text which is not really necessary even though I have deleted the category, its still appearing. Hope you guys can help get out of this stuff.
I'm not sure if there's a WordPress-specific way to do this, but you can do a quick find-and-replace for the offending terms.
I don't know if it follows a pattern, but if you have access to the site through SSH you could do a MySQL dump and find/replace/reimport easily.
mysqldump -uDBUSER -p DBNAME > mysql.dump vim mysql.dump :%s/SEARCHTERM/REPLACEMENT/g :x mysql -uDBUSER -p DROP DATABASE DBNAME; CREATE DATABASE DBNAME; USE DBNAME; SOURCE mysql.dump; QUIT
That will, in order:
- Create a backup of your database named
- Open the new database backup in Vim
- Do a find-and-replace for the whole database
- Save and close the modified file
- Log into MySQL
- Delete the current table, create a new one with the same name, select it, and load it with the modified data
- Exit MySQL
It would probably be wise to create a second backup that isn't modified just in case something goes wrong.
Also, make sure you swap out the placeholder values for database credentials, as well as your SEARCHTERM and REPLACEMENT values.
You could do all of the steps above with other tools as well (such as phpMyAdmin and a text editor); it's just a bit quicker if you can slam through it all in a terminal window. (This is especially useful if the database is too big to upload in one piece through phpMyAdmin.)
There's an even easier way to do this that I've started using. You can actually do the find-and-replace as part of the
mysqldump -uDBUSER -p DBNAME | sed -e 's/SEARCHTERM/REPLACEMENT/g' > db_dump.sql mysql -uDBUSER -p DROP DATABASE DBNAME; CREATE DATABASE DBNAME; USE DBNAME; SOURCE mysql.dump; QUIT