WordPress problem when moving foldersFebruary 26, 2012 / by Marco / Categories : Technology
I tried moving my WordPress folder to the root of my hosting account and things went pear shaped. After some debugging, I noticed that in the database stored the URL of the website. This meant I had to change most of the data entries in the database. I knew nothing about SQL queries but after some research I managed to find some code that was able to change my domain URL and here it is:
1234567 UPDATE wp_options SET option_value = replace(option_value, 'http://olddomain.com', 'http://newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl';UPDATE wp_posts SET guid = replace(guid, 'http://olddomain.com','http://newdomain.com');UPDATE wp_posts SET post_content = replace(post_content, 'http://olddomain.com', 'http://newdomain.com');UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com');
Limit to 5 sponsors.
OTHER ARTICLES YOU MAY LIKE
I recently needed to install a 960GB SSD Crucial Drive in my Metabox P950HP laptop and had no clue on how to do this. I tried removing all the screws from the back of the Metabox and pryed the back cover but it was stuck. I had a hunch there was something more to it […]read more
For those of you who are using WordPress and the Slider Revolution plugin, did you know there is a way to disable displaying the Slider Revolution on mobile? The Slider Revolution looks great on desktop but sometimes for mobiles, the experience isn’t the greatest due to the width size (text can often become too small). So […]read more