Really Simple SSL

WordPress website keeps logging me out in back-end after I switched to SSL

Every once in a while, I come across this annoying issue: a user has switched the website to SSL, and afterwards the website logs the user off on each page reload.

In most cases, the cause is that somewhere in the code the domain is forced to an http domain. For example, in the latest case, the theme’s functions.php contained the following code:

update_option( 'siteurl', '' );

update_option( 'home', '' );

As a result, on every page load, the site was forced back to http. Because WordPress keeps you logged in on a specific domain, and a https URL is a different domain, this causes you to get logged out: your log in cookie is not valid anymore for the site's domain. 

The solution is of course simple: just remove those lines! It was probably put there to quickly change the domain. 

It's also possible the domain is set in the wp-config, with this code:
define( 'WP_HOME', '' );
define( 'WP_SITEURL', '' );
But this will be picked up by Really Simple SSL automatically. So, searching in your files for “update_option( ‘siteurl'” should quickly show you where it is located.


Related articles

Leave a Reply

Join our mailing list - 8 Tips & Tricks in your inbox over the next 8 weeks!

Integrate with Really Simple SSL

Really Simple SSL offers a Free SSL Certificate from Let’s Encrypt. Do you want to integrate with Really Simple SSL as a hosting provider? Let us know!

Choose the answer that most closely resembles your proposed integration. Additional information can be entered below.
After sending the form. The pop-up will close automatically.