SQL Query Updated Revisions, Not Published Posts. How to Fix?
-
Hello!
I’d appreciate help with the following.
I used an SQL query to introduce a mass update of html tags in multiple posts:
UPDATE wp_posts SET post_content = REPLACE (post_content, '<blockquote>\n<h5>', '<blockquote class="warning">');
(where ‘\n’ is a regular expression, since two tags were on separate lines.)
As a result, all changes were made to last saved revisions of posts, not to published posts.
Moreover, now if I run
UPDATE wp_posts SET post_content = REPLACE (post_content, '<blockquote>\n<h5>', '<blockquote class="warning">') WHERE post_status = 'publish';
the query returns zero results, showing 0 published posts with
<blockquote><h5>
but in reality there are lots of published posts having them.Question:
What is the correct SQL query to run mass update?Thank you
- The topic ‘SQL Query Updated Revisions, Not Published Posts. How to Fix?’ is closed to new replies.