I developed a site locally with /%postname%/ permalink structure. I did some sample posts locally and wanted to move this entire local setup to a temporary subdomain like http://review.clientsite.com.

1.) I exported the local sql table and imported it on the real database

2.) I changed the two fields inside the wp-options table to fit the new url http://review.clientside.com

3.) I uploaded all files to the real server and got rid of the "wp-config.php" and installed wordpress on the real server.

4.) If I launch http://review.clientside.com I see the site running and everything seems to work just fine. The stylesheets, the js, everything.

However only thing that does not work are my permalinks! Every link ends in a 404 -> e.g. http://review.clientside.com/projects

I also copied the .htaccess file from my local server to the real one. I even tried dropping the entire "permalinks" field in the wp-options table and reset the permalink-structure in the permalink settings inside wp.

Any ideas on that matter?

2 Answers 2


You have to change other URLs in the database, not just in the wp_options tables. Use these queries in phpmyadmin to change post links and metadata within post and page content:

UPDATE wp_posts SET guid = replace(guid, 'http://www.olddomain.com/','http://www.newdomain.com/');

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.olddomain.com/', 'http://www.newdomain.com/');

UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://www.olddomain.com/', 'http://www.newdomain.com/');

Reset permalinks again after those changes. And also use the full search in phpmyadmin to check if your old domain is anywhere else, such as in widget or plugin data.

  • DO NOT change the guids. Those are NOT permalinks and are meant to be static once created.
    – EAMann
    Aug 14, 2012 at 17:20
  • 1
    I've used those queries for innumerable domain and localhost to domain moves and they work fine. The queries do not change the whole GUID, only the domain part of the GUID. Aug 14, 2012 at 17:24
  • I'm not saying they won't work, I'm saying you shouldn't be changing the GUID at all even when you're moving domains.
    – EAMann
    Aug 14, 2012 at 18:51
  • Thank you. But it seems the problem is somewhere else on the server. I did a clean install of wordpress on the subdomain and again – no page or post i create works - always a 404. Aug 14, 2012 at 20:32
  • Looks like a server config problem; talk to the host administrator. Is mod_rewrite enabled on server? There's a placeholder page at the main domain. But the subdomain review.clientside.com doesn't even resolve for me; it is on a LAN or accessable from the internet? Aug 14, 2012 at 20:49

My checklist for such cases is as follow:

  1. .htaccess, did I plug it in the prod website?
  2. Did I scrub the database properly?
  3. As a last resort, can I modify it in wp-config.php?

    1. -- htaccess -- One thing that is important to consider is the existance of a .htaccess file. It seems to be the most common issue.

    2. -- DB Scrub -- When migrating data local->development->staging, I personally use the following tool to "scrub" the database. Interconnect/IT (https://interconnectit.com/products/search-and-replace-for-wordpress-databases/) -- Not paid, just awesome for DB scrubbing.

    3. wp-config.php -- Alternatively, you can do the following in your wp-config.php file:

!defined('WP_SITEURL') && define('WP_SITEURL', 'http://review.clientside.com');
!defined('WP_HOME') && define('WP_HOME', "http://review.clientside.com");

In all cases, make sure to reset permalinks from WP admin, after you complete the setup.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.