Can't change WordPress Address (URL) & Site Address (URL)


I was getting insecure content warnings and noticed my logo is http:// and not https://. Upon checking, all my images in my media library point to http://, though they do redirect to their secure version. I then noticed that in Settings > General, the site address and wordpress address were both set to the http:// version. However, I cant update these to https://, when I click save changes nothing happens and they revert back to http://

Any ideas?

I managed to stumble upon a solution which seems to have worked, by using WP-CLI.

Enter WP-CLI with:
ee shell


wp option update home ‘
wp option update siteurl ‘

Hi, tried this method and now the site is throwing 404 error

@WebVendere_Co Might need to also run the following in shell with the wp-cli utility

wp search-replace '' '' --skip-columns=guid

or if you want to see what this command would change first then run

wp search-replace '' '' --skip-columns=guid --log --dry-run

Once you are comfortable with the changes, you can remove the dry-run and logs flags and run that command.

The Wordpress Codex specifically mentions that one should never change URL’s in the guid column, so make sure that you always include the --skip-columns=guid flag.

It should not have to be said, but always have backups of your database BEFORE trying any of these replace commands. If you are already in the shell that is no harder than typing wp db export, or use your favorite back plugin or tool. And of course, delete or move this file to a location OUTSIDE of your webroot when done. Nothing scares me more than seeing text readable sql dumps in the webroot.

And also check and make sure that those site home and site url are not set in the wp-config.php file or the functions.php file of the theme. Those settings would override all.