• Resolved DoJo44

    (@dojo44)


    Hello,

    by accident I entered wrong values for “WordPress Address” and “Site Address”:

    Dashboard
    -> Settings
    —> WordPress Address (URL)
    —> Site Address (URL)

    Site is using the “travelify” theme.

    Is there a way to “overwrite” wrong settings by modifying related config files? if so, which files do I have to check?

    Any help is much appreciated.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter DoJo44

    (@dojo44)

    Some additional info.

    when adding the following lines at the end of wp-config.php file

    define(‘WP_HOME’,’https://192.168.178.100:8081/WordPress/’);
    define(‘WP_SITEURL’,’https://192.168.178.100:8081/WordPress/’);

    and accessing in browser “https://192.168.178.100:8081/WordPress/wp-login.php” the login window comes up.

    When entering valid login details the following is displayed above the login window: “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”

    Properly editing and then temporarily adding one of these near the top of wp-config.php might get you back in:

    /*-either-*/
    /** @ near top of wp-config.php /*toggle on/off*
    define('WP_HOME','https://domain.com');
    define('WP_SITEURL','https://domain.com');
    /*-or-*/
    /** @ near top of wp-config.php /*toggle on/off*
    define('WP_HOME','https://www.domain.com');
    define('WP_SITEURL','https://www.domain.com');
    /*-end-*/

    Pick with or without ‘www’ and do not add a trailing slash, and then add a slash at the end of ‘/*toggle on/off*’ to activate the next two lines.

    If the above does not work, this might help nearer the bottom of wp-config:

    /** https://codex.www.ads-software.com/Changing_The_Site_URL#Relocate_method
    /* @ just above "That's all, stop editing!" in wp-config.php
    * WordPress supports an automatic relocation method intended as quick assist
    * for getting a site working after relocating it from one server to another.
    * After the "define" statements and just before "That's all, stop editing!",
    * add this next line (and a slash at the end of this one to turn it on): /*toggle on/off*
    define('RELOCATE',true);
    /* Next Login as normal after being certain of the address being sent from your browser.
    * Then look again in your browser's address bar to verify that you have logged in at the correct server.
    * If this is the case, next go to Dashboard > Settings > General and verify the address settings and save them.
    * Once the above has been completed, either remove the above 'define('RELOCATE',true);' line
    * or comment it out with '//' or change the 'true' value to 'false'.
    * Note: When the RELOCATE flag is set to 'true', the Site URL will be automatically
    * updated to whatever path is being used to access the login screen. This will get the admin
    * section up and running on the new URL, but it will not correct any other part of the setup.
    * Those will still need to be altered manually.

    If you still have trouble after getting back in, here is one more piece I have used in functions.php of a Child Theme:

    <?php
    /** @ near top of theme functions.php
    /*-either-*/
    /* @ theme/functions.php /*toggle on/off*
    update_option('siteurl','https://domain.com');
    update_option('home','https://domain.com');
    /*-or-*/
    /** @ near top of theme/functions.php /*toggle on/off*
    update_option('siteurl','https://www.domain.com');
    update_option('home','https://www.domain.com');
    /*-end-*/

    Some additional info…

    https://192.168.178.100:8081/WordPress/&#8217;

    Ah, hold the phone! This is a local installation?

    Thread Starter DoJo44

    (@dojo44)

    Hello Leejosepho,

    yes it’s a local install on a QNAP device.

    Your tip above solved the issue!

    I have added to “~WordPress/wp-content/themes/travelify/functions.php” the following lines:

    update_option(‘siteurl’,’https://192.168.178.100:8081/WordPress&#8217;);
    update_option(‘home’,’https://192.168.178.100:8081/WordPress&#8217;);

    Many thanks for your quick answer and great help – have a good weekend!

    Cool beans. I knew the code I had posted could work anywhere, but I use Xampp and the “additional info” you had posted is much different than anything I know about!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can not login after changing WordPress Address (URL) in Dashboard’ is closed to new replies.