Am looking to remove a certain string from my wordpress content. I found that the only way to do it is to run mysql query in database using regex_replace. I just couldn't figure out how to use the regex to replace this content., The string is
<ul class="md_wholebook_list"><li class="dZip"><a href="https://example.com/demo/file.zip" title="file.zip" download>Download ZIP</a></li></ul>
The string https://example.com/demo/file.zip
and file.zip
will be the varying parameters.
This is what I did,
<ul class="md_wholebook_list"><li class="dZip"><a href="(.*?)\.zip" title="(.*?)\.zip" download>Download ZIP</a></li></ul>
Actually I don't wanna mess with my database, so any wordpress function or php function is much better.If at all only mysql query works, am willing to take the shot.
This is the sql query I ran through my phpmyadmin.
SELECT REGEXP_REPLACE(`post_content`,'<ul class="md_wholebook_list"><li class="dZip"><a href="(.*?)\.zip" title="(.*?)\.zip" download>Download ZIP</a></li></ul>','')
Is tat right?