and run it in the hope that i can remove as more text strings as possible (each author usually wrote 1 to 50 posts). if i'm lucky i can remove 50 text strings in a sql run, else just 7 like in this case (that's frustrating)http://i.imgur.com/Mo6g5.png

Luckily the content of all posts has the same structure: after the name of the author i find the text

so i think that there could be a way to find the name of all authors and create a query to remove them.

What i need:

A way to obtain a sql query containing all the instructions ready to be run like this (hand made) example:

update wp_posts set `post_content` = replace(post_content,' Written by Alfred Jingle','');update wp_posts set `post_content` = replace(post_content,' Written by Steve Rahaman','');update wp_posts set `post_content` = replace(post_content,' Written by Corey Hatch','');update wp_posts set `post_content` = replace(post_content,' Written by Huggo','');update wp_posts set `post_content` = replace(post_content,' Written by Leo &#x3C;mleonar1@ic3.ithaca.edu&#x3E;','');update wp_posts set `post_content` = replace(post_content,' Written by Tad Dibbern &#x3C;DIBBERN_D@a1.mscf.upenn.edu&#x3E;','');update wp_posts set `post_content` = replace(post_content,' Written by &#x3C;jhailey@hotmail.com&#x3E;','');update wp_posts set `post_content` = replace(post_content,' Written by Steve Richer &#x3C;sricher@sympatico.ca&#x3E;','');update wp_posts set `post_content` = replace(post_content,' Written by Murray Chapman &#x3C;muzzle@cs.uq.oz.au&#x3E;','');update wp_posts set `post_content` = replace(post_content,' Written by Anonymous','');update wp_posts set `post_content` = replace(post_content,' Written by Abatoli Maksimov','');update wp_posts set `post_content` = replace(post_content,' Written by Orange','');update wp_posts set `post_content` = replace(post_content,' Written by Ed Sutton &#x3C;esutton@mindspring.com&#x3E;','');update wp_posts set `post_content` = replace(post_content,' Written by Jim Beaver &#x3C;jumblejim@prodigy.net&#x3E;','');update wp_posts set `post_content` = replace(post_content,' Written by John Vogel &#x3C;jlvogel@comcast.net&#x3E;','');update wp_posts set `post_content` = replace(post_content,' Written by FilmFanUK','');update wp_posts set `post_content` = replace(post_content,' Written by Film_Fan','');update wp_posts set `post_content` = replace(post_content,' Written by Sujit R. Varma','');update wp_posts set `post_content` = replace(post_content,' Written by Sujit R. Varma','');update wp_posts set `post_content` = replace(post_content,' Written by Anthony Pereyra {hypersonic91@yahoo.com}','');update wp_posts set `post_content` = replace(post_content,' Written by KGF Vissers','');update wp_posts set `post_content` = replace(post_content,' Written by Jes Beard &#x3C;jesbeard@bellsouth.net&#x3E;','');update wp_posts set `post_content` = replace(post_content,' Written by anonymous','');update wp_posts set `post_content` = replace(post_content,' Written by IMDb Editors','');update wp_posts set `post_content` = replace(post_content,' Written by Ryan McIntosh &#x3C;Save_Ferris85@hotmail.com&#x3E;','');update wp_posts set `post_content` = replace(post_content,' Written by Sean Daly','');update wp_posts set `post_content` = replace(post_content,' Written by matt-282','');update wp_posts set `post_content` = replace(post_content,' Written by Grand Ilusions','');update wp_posts set `post_content` = replace(post_content,' Written by Jonathan Ruskin &#x3C;JonRuskin@aol.com&#x3E;','');update wp_posts set `post_content` = replace(post_content,' Written by PhatBleek','');update wp_posts set `post_content` = replace(post_content,' Written by Julian Reischl &#x3C;julianreischl@mac.com&#x3E;','');update wp_posts set `post_content` = replace(post_content,' Written by Jeff Hole &#x3C;jeffhole@aol.com&#x3E;','');update wp_posts set `post_content` = replace(post_content,' Written by Michael Feller &#x3C;reb@magna.com.au&#x3E;','');update wp_posts set `post_content` = replace(post_content,' Written by Tim Kretschmann &#x3C;Tim.K@VirComm.com&#x3E;','');update wp_posts set `post_content` = replace(post_content,' Written by Tony B','');update wp_posts set `post_content` = replace(post_content,' Written by Stephen Currence &#x3C;billyc@erols.com&#x3E;','');update wp_posts set `post_content` = replace(post_content,' Written by wb','');update wp_posts set `post_content` = replace(post_content,' Written by MGM Studios','');

I would a regular expression for this. The key point is to establish the end of pattern. It clearly starts with "Written by" and it seems to end with a double quote. On that basis we can take code like this sample

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

i'd like to add thet the example i've provided will not work for all possibilities, i guess that the "written by part is in most cases at the end of the article -as per your example- so then we begin searching from the end and should only update the last "written by bla bla bla "</span></p><p>" in your table :

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1)) - (INSTR(post_content, '. Written by',-1)) )), ''))' at line 1

SELECT SUBSTRING(post_content FROM LOCATE('. Written by ', post_content) FOR (LOCATE('"</span></p><p>', post_content) - LOCATE('. Written by ', post_content))) FROM wp_posts WHERE post_content like '%. Written by %'

Featured Post

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users