I switched my web from http to https by using "Better search and replace" and everything worked fine - at first sight.

All resources were deliverd via https and the Firefox showed a green lock. But when now uploading a new image I saw that it will be delivered via http.

I immediatle checked my db but in options/home and options/siteurl the entry is https. In wp-config I also use define('FORCE_SSL_ADMIN', true);. And now the curious thing: When checking the WordPress Address (URL) under "Settings/General" there is a http-entry which cannot be edited.

The db says https but the backend says http

The db says https but the backend says http... I´m really helpless... What can I do?

  • Are you setting the URL in wp-config.php? Is this a multisite install? Did you configure your server to redirect insecure requests to HTTPS? – Tom J Nowell Jun 7 '18 at 16:39
  • Home and siteurl are not set in the wp-config.php and it‘s no multisite install. But I redirect all http requests and non—www to www in my htaccess (as in most of my WP installs). I already replaced all entries in the db from http to https via Better Earch And Replace, but still the same problem... :( – Mel Jun 8 '18 at 11:18

It is possible to hardcode the value of the "Wordpress Address (URL)" and "Site Address(URL)" options within your wp-config.php file. When the value of either field is hardcoded this way, it takes precedence over the respective value set in the database. This is why you cannot edit the field via the Wordpress Admin Page ( the value is hardcoded ).

My suggestion to resolving your issue is this:

1) Open your wp-config.php file
2) Look for a line of code similar to the one below


3) delete it

That's it! You should now be able to edit the "Wordpress Address (URL)" from the admin page.

Reference: https://codex.wordpress.org/Changing_The_Site_URL#Edit_wp-config.php

| improve this answer | |
  • Home and siteurl are not set in the wp-config.php. That´s why I don´t understand that in WP backend the field is uneditable...? – Mel Jun 8 '18 at 11:19
  • After some testing on my end, it looks like it's also possible to define the HOME and SITEURL outside of wp-config.php via the same method as the one in my answer. The next step would then be to check your plugins and theme. First check to see whether the site and home urls are set in the functions.php file of your theme. If it's not, then you can move on to checking whether it is set by within one of your plugins by disabling all of them. – LuisD Jun 8 '18 at 14:39
  • Yes, I´m afraid I have to check all my plugins for bugfixing... But thanks for your try... – Mel Jun 8 '18 at 17:58
  • I tried to bugfix it and deactivated all plugins, changed the theme to twentyseven, searched the database and also made a search through all files in the wp folder. But i found nothing! There´s still http instead of https. And I still cannot edit the field. Any idea what to do now? I´m really desperate :) – Mel Jun 11 '18 at 15:37
  • Try hard-coding the new value of the Wordpress Address (URL) by adding define('WP_SITEURL','https://www.example.com'); to your wp-config.php file. If the change doesn't take effect then that indicates to me that this the change might be hardcoded at a point in time earlier than when wp-config.php is read - meaning that it might be set in a WP core file like index.php or wp-blog-header.php. If it DOES take effect then it might be defined at some point in time after wp-config.php is loaded but before theme files take effect ( e.g wp-settings.php ). – LuisD Jun 11 '18 at 17:28

Oh my god, call me noob of the month... ;)

The problem was in fact a small line of code at the bottom of the wp-config.php which I always use in my WP webs to change the content folder's name.

I changed it and now it works.

| improve this answer | |

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.