Answer the question
In order to leave comments, you need to log in
How to change WordPress URL?
Now the address is ip, now I want to put my domain, but it doesn’t work. The site is on vps, I created an A record in the dns of the domain and sent it to the hosting ip. When I change the site address and WordPress in the general settings to my domain and click save, it simply redirects me to the admin login page at the old address.
Already wrote in wp-config.php:
define('WP_HOME',' http://new-site-url.ru ');
define('WP_SITEURL',' http://new-site-url.ru ');
And in functions.php:
update_option('siteurl',' http://new-site-url.ru ');
update_option('home',' http://new-site-address.ru ');
How can I link my domain?
Answer the question
In order to leave comments, you need to log in
In the site database, in the wp_options table, there is an entry something like site_roor => 'value', open the database through phpmyadmin, or another editor, and replace the value of the entry with the value of the new address ' http://new-site-address.ru '
the best solution that I found in my time, so as not to change the paths of all articles, images, etc. this plugin is https://wordpress.org/plugins/all-in-one-wp-migration/ . Create a backup of the previous site, install a bare vp on the new domain and import it with the same plugin. Your theme will be downloaded, all plugins, settings, articles and all mentions of the old domain will be replaced with the new one.
You can use wp-cli. Download it to the site folder
And run
You can see more here .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question