My Wordpress Address (URL) in general settings keeps losing the www from the URL - I type in http://www.domain.com and it saves and works fine.

Next time I go in the address has changed to http://domain.com. So again I change it, I get logged out and I log back in and it looks fine until next time and it has changed again.

This is the only setting which changes (site address keeps the www) and I have checked my htaccess and cannot see anything untoward and there are no parked domains etc - any idea what could be causing this?

Most of the time it doesn't cause any issues but sometimes when I visit the site it defaults to the non www version which could be detrimental to SEO as well as it affects my SSL for some secure pages as I only have the SSL for www.domain.com so I would like to fix it if I can.

  • Disable all of your plugins and try it, and switch to a default theme.
    – s_ha_dum
    Jan 29, 2013 at 14:52
  • I was hoping to avoid that as it doesn't happen right away (I have just logged in again and it still shows the www) so that would mean my site would, in effect, be down until it did it again which I want to avoid if I can but it may come to this so thanks for the suggestion
    – bhttoan
    Jan 29, 2013 at 15:03
  • It isn't normal behavior so some non-core something is likely the culprit. You have to find out what. If you don't have a development server to do your debugging on that is going to be painful.
    – s_ha_dum
    Jan 29, 2013 at 15:50

2 Answers 2


You could possibly set the URL in your wp-config.php, this will override the URL stored in the database (the one set in general settings):

// ** Home- und Site-URL ** //
define( 'WP_HOME', 'http://www.example.com' );
define( 'WP_SITEURL', 'http://www.example.com' );

So this should help to keep the www in your URL, but of course it doesn’t solve the strange behaviour itself. One thing I could think of: Can you check if update_option( 'siteurl', 'http://example.com' ); is set anywhere? Typically this is set in functions.php and is used for changing the URL without having access to the backend.


Ensure that you haven't defined it in your wp-config.php


  • I have checked both wp-config and wp-settings and there are no references in either, thanks for the suggestion
    – bhttoan
    Jan 29, 2013 at 15:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.