I like to replace all my custom headlines in my wordpress blog posts with regulat “h” headlines. For example:
[x_custom_headline type=“left“ level=“h2″ looks_like=“h3″]Here is the headline[/x_custom_headline]
should replaced to
<h2>Here is the headline</h2>
and
[x_custom_headline type=“left“ level=“h3″ looks_like=“h7″]Here is another headline[/x_custom_headline]
should replaced by
<h3>Here is another headline</h3>
I have more than 1000 posts, so doing this manually would take weeks or month...
T tried something like:
UPDATE wp_posts
SET post_content = REPLACE(
REPLACE(post_content, '[x_custom_headline type="left" level="h2" looks_like="h3"]', '<h2>'),
'[/x_custom_headline]','</h2>')
WHERE post_content LIKE '[x_custom_headline type="left" level="h2" looks_like="h3"]%[/x_custom_headline]';
...but the WHERE condition does not work in this query.
Can anybody maybe help me to find the right SQL query (maybe regex?) to update this directly in the database?
This is a typical post structure:
Post Content
[x_custom_headline type="left" level="h2" looks_like="h3"]This is a h2 headline[/x_custom_headline]
Post Content
[gallery ids="92149,92151,92153,92155"]
More Post Content
[x_custom_headline type="left" level="h3" looks_like="h7"]This is a h3 headline[/x_custom_headline]
More Post Content
[x_custom_headline type="left" level="h3" looks_like="h7"]This is a h3 headline[/x_custom_headline]
More Post Content
<img src="image-url" class="skip-lazy"/>
[x_custom_headline type="left" level="h2" looks_like="h3"]This is a h2 headline[/x_custom_headline]
More Post Content
[sc name="reiseberichte-seychellen"]
More Post Content
Michael