admin管理员组文章数量:1122846
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.
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.
Share Improve this question asked Apr 19, 2019 at 0:05 warm__tapewarm__tape 611 silver badge11 bronze badges 1- 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 Commented Apr 19, 2019 at 15:17
1 Answer
Reset to default 0If 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'.
本文标签: functionsStrip all HTML tags from product content and resave
版权声明:本文标题:functions - Strip all HTML tags from product content and resave 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736301553a1931216.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论