Barry Hughes WordPress Developer

You are browsing posts tagged “ssl”.

No SSL, thanks

9 July 2019 (updated 9 July 2019)

I love my HTTPS as much as the next person, but for local dev purposes it can be handy to disable this in the context of working on a WooCommerce project.

To that end…adding the following bits of code can be helpful.

add_action( 'init', function() {
	remove_action( 'template_redirect', [ 'WC_HTTPS', 'force_https_template_redirect' ] );
} );

The above should be added to a (mu-)plugin, accompanied by the following in the site’s (wp-)config.php file:

define( 'FORCE_SSL', false );
define( 'FORCE_SSL_ADMIN', false );
define( 'FORCE_SSL_LOGIN', false );

Of course, this is for ease of local development only.