I recently set up my WordPress website and just noticed that if I click the home page from any other page, it points to the IP of my instance and the website won’t load. I have checked the URL(s) from the admin panel SettingsGeneral. They are correctly configured but currently grayed out. Is the only solution to this is to edit the wp-config.php file?


The URLs are greyed out in the Settings page because of the entries in the wp-config.php file. If there are entries for these values, those values override the values in the wp-options table, and the override makes the Settings values uneditable.

See this in the Codex: https://wordpress.org/support/article/changing-the-site-url/

It is possible to set the site URL manually in the wp-config.php file.

Add these two lines to your wp-config.php, where example.com is the correct location of your site.

define( 'WP_HOME', 'http://example.com' );
define( 'WP_SITEURL', 'http://example.com' );

This is not necessarily the best fix, it’s just hard-coding the values into the site itself. You won’t be able to edit them on the General settings page anymore when using this method.

(Emphasis added)

That's why I am not a big fan of making URL changes in the wp-config.php file. I think it is better (and more proper) to change those values in the wp-options table. (IMHO).

Look at your wp-config.php for those two 'defines'. I'd bet that you would find values there. I think that it is better to put those URLs in the wp-options table. Again, IMHO.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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