This site WordPress URL settings do not match host set in local

What that message is saying is that Local thinks the URL for the site should be one thing, but for whatever reason, the URL within the database is another value.

There could be a lot of underlying reasons for this, but this is going to be tricky to diagnose if you are unsure what the original domain was.

You could try guessing what the original domain was by looking at the path:

Basically, Local will convert the site’s name so that:

  • Spaces are transformed to dashes
  • special characters like apostrophe or question mark are stripped out

If guessing that domain doesn’t work, then you could try using wpcli in the terminal.

To do this:

  1. Right-click on the site in Local and select “Open Site Shell”

  2. Issue this command to get the domain that’s within the DB:

    wp option get siteurl --skip-plugins --skip-themes