👈 back home

Change WordPress Post URL

Published 2015-01-24

Change Author on all posts at once

SELECT ID, display_name FROM wp_users;
UPDATE wp_posts SET post_author=NEW_AUTHOR_ID WHERE post_author=OLD_AUTHOR_ID;

Update URL Path

-- option table
UPDATE wp_options SET option_value = REPLACE(option_value, 'http://localhost/wordpress', 'http://www.yourlivedomain.com') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET guid = REPLACE(guid, 'http://localhost/wordpress', 'http://www.yourlivedomain.com');

-- content
UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://localhost/wordpress', 'http://www.yourlivedomain.com');

Update Post Meta

UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, 'http://localhost/wordpress', 'http://www.yourlivedomain.com');