Settings > General: Site Address (URL)
- What it controls
- The address you want people to type in their browser to reach the site. This is what the www choice is
- Source
- WordPress.org Settings General screen
Set the WordPress Site Address to www or non-www, see what redirect_canonical already does, and add a server redirect for what it skips. Test with curl.
Your Site Address (URL) in Settings > General decides the preferred hostname. WordPress core's redirect_canonical() then redirects requests for the www or non-www twin to that host. It skips admin, feeds, robots.txt, favicon.ico and POST requests, so add a permanent server redirect if other hostnames reach your site directly.
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
Site Address (URL)WP_HOME and WP_SITEURL in wp-config.phpredirect_canonical()home_url(), in PHP, once the request reaches WordPressRedirect, mod_rewrite)The redirect_canonical() reference says search engines consider www.somedomain.com and somedomain.com to be two different URLs when they both go to the same location, and that the function redirects all incoming links to one or the other. Its source comments say it redirects only between no-www and yes-www, and ignores differences in host capitalization to avoid infinite redirects.
Google's redirect guide says that when a site is reachable several ways, it is a good idea to pick one URL as your preferred (canonical) destination and use redirects to send traffic from the others. It does not say which form is better, so choose the one your DNS and certificate already cover, then do not flip it later without a reason.
Set Site Address (URL) to the exact form you want, for example https://www.example.com. WordPress says both settings should include https:// and have no trailing slash.
WordPress Address (URL) is where the core files live. WordPress says the two are identical unless you give WordPress its own directory, so a www change normally means updating both.
If WP_SITEURL or WP_HOME is defined in wp-config.php, the field shows that value and is locked. Edit the constants instead, using the form WordPress documents.
After saving, confirm you can still reach wp-admin. WordPress warns that people who change these fields sometimes find the site no longer works properly and have to fix the values by other means.
define( 'WP_HOME', 'https://example.com' );
define( 'WP_SITEURL', 'https://example.com' );robots.txt and favicon.icoredirect_canonical() returns early for other methodscurl shows a single 301 to your chosen host on a post and the home pageApache's rewrite guide says the best way to force one hostname does not involve mod_rewrite at all, and instead uses the Redirect directive in a virtual host for the non-canonical hostnames. Google's redirect guide gives the permanent form, Redirect permanent "/old" "https://example.com/new". Combined, for a site that should live on the www host (this catches port 80 only, as in Apache's example, so the bare domain's HTTPS virtual host needs its own Redirect):
<VirtualHost *:80>
ServerName example.com
Redirect permanent "/" "https://www.example.com/"
</VirtualHost>For the reverse, Apache's guide shows how to strip the prefix with mod_rewrite by swapping the condition:
RewriteCond "%{HTTP_HOST}" "^www\.(.+)$" [NC]
RewriteRule "^(.*)" "http://%1/$1" [L,R,NE]That recipe sends to http://, so on an HTTPS site change the scheme, then confirm the status code with the curl test below. Google recommends a permanent server-side redirect whenever possible, and says the 301 and 308 status codes mean a page has permanently moved. nginx matches hostnames through server_name (for example server_name example.org www.example.org;); the nginx page used here does not give a redirect recipe, so use your host's guidance.
Run curl -sIL http://example.com/ | grep -i -E '^(HTTP|location)', swapping in the non-preferred host. You want one hop to the preferred host. Repeat on a post URL, not only the home page.
It should return 200 with no redirect to the other form. Repeat for https:// and http:// variants and count the hops. Fewer is better; see redirect chains.
The canonical tag, internal links and sitemap URLs should all use the preferred host. See WordPress canonical tags and WordPress XML sitemap.
If both versions are already indexed, see www vs non-www. Google lists redirects as a strong signal that the target should become canonical.
For ordinary page moves instead of the hostname, use WordPress redirects.
3 questions people ask next, answered from the sources on this page.
Its redirect_canonical() function redirects between the www and non-www form to match the host in home_url(), which follows your Site Address. It does not redirect admin, feeds, trackbacks, searches, robots.txt, favicon.ico, or POST requests.
In Settings > General, use the Site Address (URL) field. If WP_HOME or WP_SITEURL is defined in wp-config.php, the field is locked and you edit the constants.
Google's redirect guide says to pick one preferred URL and use redirects to send traffic from the others. It does not name one form as better.
Run the free audit, then approve the fixes. Every change can be undone.