↑ ↓ select, Enter open, Esc close

Read the siteurl and home addresses

Adjust the values, the command updates live
user@server
wp option get siteurl --path=/var/www/vhosts/example.com/httpdocs && wp option get home --path=/var/www/vhosts/example.com/httpdocs

Prints the two options siteurl (address of the WordPress files) and home (address of the website). Wrong values lead to redirects to old domains, endless loops or mixed http and https. Both values should normally be identical and contain the desired protocol.

Note: If WP_HOME or WP_SITEURL are set in wp-config.php, these constants override the database values.

Also searched as

  • check wordpress site url
  • wordpress redirects to wrong domain
  • wordpress redirect loop

Related one-liners

All in WP-CLI

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.