Change the siteurl and home addresses
wordpress change site url command line | set wordpress url to https | wrong wordpress address entered | wp-cli | options | migration | seoCaution: This command changes the system. Understand what it does before you run it.
wp option update siteurl 'https://example.com' --path=/var/www/vhosts/example.com/httpdocs && wp option update home 'https://example.com' --path=/var/www/vhosts/example.com/httpdocsOverwrites the siteurl and home options with the given address, without a trailing slash. Restores access when a wrong address was accidentally entered in the dashboard. Important for SEO: the address set here determines canonical URLs, the sitemap and internal links.
Note: This does not change content with old URLs. Use wp search-replace for that as well.
Also searched as
- wordpress change site url command line
- set wordpress url to https
- wrong wordpress address entered