How to change WordPress website URL and image Path

Do you know how to change WordPress URL? For example, if you want to move WordPress to a new server or a new domain, what do you do now?

In today’s post, I will tell you some WordPress skills. By simply executing a SQL query against your WordPress database, you can make the important changes easily and efficiently. Enjoy!

Shown below are some SQL queries that can be of great assistance to you when using WordPress.

WordPress website URL and image Path

1.Change WordPress Blog Siteurl and Homeurl

UPDATE wp_options SET option_value =
REPLACE(option_value, '',
'') WHERE option_name =
'home' OR option_name = 'siteurl';

2.Change WordPress URL in Content

UPDATE wp_posts SET post_content = REPLACE
(post_content, '',

3.Change WordPress Image Path

UPDATE wp_posts SET post_content = REPLACE
(post_content, 'src="',

4.Change Default “Admin” Username

UPDATE wp_users SET user_login = 'Your New Username'
WHERE user_login = 'Admin';

5.Change WordPress Password – if you forget WordPress Password

UPDATE wp_users SET user_pass =
MD5( 'new_password' ) WHERE user_login = 'your-username';

If you want to move your WordPress blog across domains or forget password, the above SQL queries can be useful and help speed things up for you.

Good luck!