0

My client has loaded about 500 products into Woocommerce, but has inadvertently pasted in a stack of extra tags into the product description- divs and spans etc like below:

<div class="summary entry-summary">
Colours – Blush, Burgundy, Dusty Rose, Mauve, Navy, Sage
Sizes- XS- 3XL
</div>

What would be the easiest way to strip everything except for the plain text content and resave the "cleaned" product description?

I've tried the solution suggested over at Filter/Remove HTML Elements on all posts and pages but it did not seem to do anything.

  • the easiest way would be to delete and then reload the corrected data. Other than that you could run an sql query and get rid of them all. – rudtek Apr 19 at 15:17
0

If there aren't any CSS classes with the names of those spans, then there is no need to remove them, as they won't change the visual look of the output.

But there are Search and Replace plugins that will do that for you. (My favorite is "Search and Replace Plugin". ) You would just need to be very careful in how you specify the search string, So a backup of the database is really important.

If you want to remove all 'spans', for example, there are regex expressions that you can use. They are quite specific, and regex is not easy, but there are lots of googles (or bings or ducks) to help you with the process.

You can also use phpMyAdmin to directly interface with the database. That requires a bit more experience; you didn't mention your level of experience.

And again, backups of the database before you start is important. You might even clone the site to 'practice'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.