WordPress problem when moving folders

February 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:

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');
DO YOU LIKE WHAT YOU'VE READ?
Join our subscription list and receive our content right in your mailbox. If you like to receive some Great deals our Freebies then subscribe now!

Our Sponsors

  • Follow us:

OTHER ARTICLES YOU MAY LIKE


HOW TO GET FREE UPGRADE TO PERPLEXITY.AI PRO FOR 12 MONTHS AND TESTING PRO FEATURES

HOW TO GET FREE UPGRADE TO PERPLEXITY.AI PRO FOR 12 MONTHS AND TESTING PRO FEATURES

If you spend time researching, comparing, or synthesising information online, you have probably encountered Perplexity.ai — a research-focused assistant that blends large language models with live web search and citation trails. The Pro plan supercharges that experience with priority access to powerful models, higher usage limits, and premium capabilities baked directly into the interface. Right […]

read more
VidTechy: The Ultimate Tool for AI-Powered Video Optimization

VidTechy: The Ultimate Tool for AI-Powered Video Optimization

Unlock the potential of your videos with VidTechy, the ultimate AI-powered tool for seamless video optimization and enhanced viewer engagement.

read more

Like our Page