Change wordpress URL mysql

Change wordpress URL mysql

You move your wordpress to a different URL and you can’t access wp-admin to login and change it.

Solution:

Connect to database from command line.

select * from wp_options where option_name =’siteurl’;

update wp_options set option_value =’http://newaddress’ where option_name=’siteurl’;

You’ve ever moved your WordPress site to another location and all your images are broken because they all point to the old domain.

Solution

UPDATE wp_posts SET POST_CONTENT = replace(POST_CONTENT, 'myolddomain.com', 'localhost/sandbox');