{"id":3871,"date":"2017-03-28T17:42:55","date_gmt":"2017-03-28T16:42:55","guid":{"rendered":"https:\/\/www.kevinmaschke.com\/?p=3871\/"},"modified":"2025-11-23T23:55:56","modified_gmt":"2025-11-23T23:55:56","slug":"ssl-https-wordpress","status":"publish","type":"post","link":"https:\/\/www.kevinmaschke.com\/en\/ssl-https-wordpress\/","title":{"rendered":"SSL (HTTPS) with WordPress"},"content":{"rendered":"\n<p>Security is important for the web. <strong>SSL is the current security standard to establish safe connections between a server and a browser<\/strong> (HTTPS) and it makes sure that all data sent between the browser and the server is kept private and secure. Apart from allowing for safe &nbsp;internet browsing, <strong>SSL is also very important in other aspects, such as SEO<\/strong>. More and more search engines (like Google or Bing) favour in their search results pages that use a valid SSL certificate and penalize those that do not use one.<\/p>\n\n\n\n<p>Most of the available services to get a valid SSL certificate are not free, but <strong>using <a href=\"https:\/\/letsencrypt.org\/\" target=\"_blank\" rel=\"noopener\">Let&#8217;s Encrypt<\/a> we can automatically, and without any cost, create and renew valid SSL certificates<\/strong>. I personally use this service and can only recommend it.<\/p>\n\n\n\n<p>But let&#8217;s suppose that we already have our SSL certificate and that we&#8217;ve configured it on our web server, but WordPress still doesn&#8217;t seem to use it. For WordPress to make use of our certificate on the whole website and administration panel and secure the connections, we need to follow the following steps:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Update the WordPress address and site address.<\/h2>\n\n\n\n<p>To do so, login and open the administration panel. Go to Settings &gt; General.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/02\/28195755\/URL.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"967\" height=\"148\" src=\"https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/02\/28195755\/URL.jpg\" alt=\"Wordpress URL\" class=\"wp-image-3773\" title=\"Wordpress SSL HTTPS\" srcset=\"https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/02\/28195755\/URL.jpg 967w, https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/02\/28195755\/URL-400x61.jpg 400w, https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/02\/28195755\/URL-100x15.jpg 100w, https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/02\/28195755\/URL-406x62.jpg 406w, https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/02\/28195755\/URL-883x135.jpg 883w\" sizes=\"auto, (max-width: 967px) 100vw, 967px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>Here you change the URLs <strong>replacing HTTP for HTTPS<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Update the&nbsp;WP-Config.php file<\/h2>\n\n\n\n<p>Open the&nbsp;<code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">wp-config.php<\/code>&nbsp;file to for editing. Search for a line that says &#8220;Stop Editing Here&#8221; and above that line paste the following two:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">define('FORCE_SSL', true);\ndefine('FORCE_SSL_ADMIN',true);<\/pre>\n\n\n\n<p><strong>This configuration will force WordPress to use SSL<\/strong> (HTTPS) in all connections to the website and administration panel.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Force the URL to use HTTPS.<\/h2>\n\n\n\n<p>For this, open the <code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">.htaccess<\/code> file for editing. <strong>There should be a default configuration for WordPress in there<\/strong>, and under the first line <code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">RewriteEngine On<\/code> you paste the following two lines:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">RewriteCond %{HTTPS} !=on\nRewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}%{REQUEST_URI} [L,R=301]<\/pre>\n\n\n\n<p>Once you save the file and upload it to the server, your website will be secure and use HTTPS correctly on all connections.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Plugin<\/h2>\n\n\n\n<p>I personally prefer to do these configurations manually as described above, but<strong> there are also some WordPress Plugins which allow to do all this for those who prefer not to edit any files<\/strong>. One very easy to use and that offers all features to configure SSL is <strong><a href=\"https:\/\/en-gb.wordpress.org\/plugins\/really-simple-ssl\/\" target=\"_blank\" rel=\"noopener\">Really Simple SSL<\/a><\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Security is important for the web. SSL is the current security standard to establish safe connections between a server and a browser (HTTPS) and it makes sure that all data sent between the browser and &#8230;<\/p>\n","protected":false},"author":1,"featured_media":3832,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[410,225],"tags":[1049,1050,570],"class_list":["post-3871","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guides","category-web-en","tag-https-en","tag-ssl-en","tag-wordpress-en"],"acf":{"book_cover":null,"special_featured_image":null},"_links":{"self":[{"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/posts\/3871","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/comments?post=3871"}],"version-history":[{"count":0,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/posts\/3871\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/media\/3832"}],"wp:attachment":[{"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/media?parent=3871"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/categories?post=3871"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/tags?post=3871"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}