WordPress: MySQL Search and Replace using PHPMyAdmin
I made a slight modification to my page layouts today. I’ve read on John Chow’s blog and on Problogger’s blog that positioning your advertisement within the body of a post can result in a dramatic increase in revenue. Dean is working on his as well.
On Darren’s site, he writes that it’s simply a matter of the readers eye movement. When the banner is at the top of the page, the reader skips over it with no focus. However, when the advertisement is to the right of the content, the reader will actually skim over it.
You’ll notice that I still try to keep my home page clean – putting advertisements outside of the blog posts. I’m certain that changing that and making them more intrusive could make me more revenue; however, I’ve always fought that because it would really affect the readers I care about most – the ones that visit my home page daily.
One of the issues with putting this advertisement in the top right was that this is where I often place a graphic for aesthetic purposes and to dress up my feed and differentiate it from other feeds. I usually alternate a piece of clipart either right or left in the post using:
Image Left:
<img align="left" src="pic.jpg">
Image Right:
<img align="right" src="pic.jpg">
Note: Some folks like to utilize styles for this, but the alignment doesn’t work in your feed utilizing
CSS.Updating every post using Search and Replace:
To easily modify ever single image in every single post to ensure all my images are left justified can be done quite easily using an Update query in PHPMyAdmin for MySQL:
update table_name set table_field = replace(table_field, 'replace_that', 'with_this');
Specific to WordPress:
update `wp_posts` set `post_content` = replace(`post_content`, 'replace_that', 'with_this');
To correct my issue, I wrote the query to replace “image=’right'” with “image=’left'”.
NOTE: Be absolutely certain to backup your data prior to making this update!!!