Global Find and Replace In WordPress using MySQL
February 4, 2009 | Barry Wise | Code Samples, Database
30 Comments
In case you ever need to find and replace a text string in every post or page of your Wordpress site, this SQL code will help you out. I recently had to move a client’s website from staging into production, and just when I was getting ready to publish the new site I realized Wordpress’s HTML editor had hard-coded the URLs of every image in every post to the address of the staging server. This is actually a feature of Wordpress; when you upload an image into a post or page it uses an absolute URL, not a relative one. This really helps you out if any of your posts get picked up via RSS and published elsewhere, since the images will remain intact thanks to the absolute URLs.
Tags: code sample, Database, find and replace, mysql, search and replace, wordpress
Database Normalization And Design Techniques
January 12, 2008 | Barry Wise | Database
5 Comments
One of the most important factors in dynamic web page development is database definition. If your tables are not set up properly, it can cause you a lot of headaches down the road when you have to perform miraculous SQL calls in your PHP code in order to extract the data you want. By understanding data relationships and the normalization of data, you will be better prepared to begin developing your application in PHP.
Tags: Database, database definition, Database Normalization, design, normal form





