{"id":93,"date":"2020-07-26T01:28:29","date_gmt":"2020-07-25T19:43:29","guid":{"rendered":"http:\/\/babal.host\/blog\/?p=93"},"modified":"2023-01-04T19:11:38","modified_gmt":"2023-01-04T13:26:38","slug":"how-to-update-all-http-urls-to-https-in-wordpress","status":"publish","type":"post","link":"https:\/\/babal.host\/blog\/how-to-update-all-http-urls-to-https-in-wordpress\/","title":{"rendered":"How to update all HTTP URLs to HTTPS in WordPress"},"content":{"rendered":"\r\n<p>Have you ever faced an issue with forcing HTTPS on your website as there are still some insecure links that are being loaded? If so, keep reading further as we have got the fitting solution for you.<\/p>\r\n\r\n\r\n\r\n<p>In the following post, we&#8217;ll look into how we can replace all the links in the WordPress database to https from http. All this can be done automatically by simply using a free plugin called &#8216;Search &amp; Replace&#8217;.<\/p>\r\n\r\n\r\n\r\n<p>For this demonstration purpose, we&#8217;re using craigfairbrass.co.uk whose mixed content details looked like this:<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"818\" class=\"wp-image-101\" src=\"https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/craig-mixed-content-1024x818.png\" alt=\"\" srcset=\"https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/craig-mixed-content-1024x818.png 1024w, https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/craig-mixed-content-300x240.png 300w, https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/craig-mixed-content-768x614.png 768w, https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/craig-mixed-content.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\r\n\r\n\r\n\r\n<p>Here are the step by step procedure which you can take:<\/p>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li>\r\n<p>Login to your WordPress admin area<\/p>\r\n<\/li>\r\n<li>From the menu in the left hand side bar &#8211; click on <strong>Plugins &gt; Add New<\/strong> as in the image below:\r\n<p>&nbsp;<\/p>\r\n<figure class=\"wp-block-image\">\r\n<figure>\r\n<figure><img loading=\"lazy\" decoding=\"async\" width=\"398\" height=\"122\" class=\"wp-image-94\" src=\"https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/http-to-https_1.png\" alt=\"\" srcset=\"https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/http-to-https_1.png 398w, https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/http-to-https_1-300x92.png 300w\" sizes=\"auto, (max-width: 398px) 100vw, 398px\" \/><\/figure>\r\n<\/figure>\r\n<\/figure>\r\n<\/li>\r\n<li>Search for &#8220;Better Search Replace&#8221;:\r\n<figure>\r\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-95 size-large\" src=\"https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-1024x503.png\" alt=\"\" width=\"1024\" height=\"503\" srcset=\"https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-1024x503.png 1024w, https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-300x147.png 300w, https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-768x377.png 768w, https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-1536x754.png 1536w, https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace.png 1697w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\r\n<\/figure>\r\n<\/li>\r\n<li>Click on &#8220;Install Now&#8221; next to &#8220;Better Search Replace&#8221; plugin box:<br \/>\r\n<figure>\r\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-96\" src=\"https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-install.png\" alt=\"\" width=\"843\" height=\"331\" srcset=\"https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-install.png 843w, https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-install-300x118.png 300w, https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-install-768x302.png 768w\" sizes=\"auto, (max-width: 843px) 100vw, 843px\" \/><\/figure>\r\n<\/figure>\r\n<\/li>\r\n<li>Click on &#8220;Activate&#8221; next to &#8220;Better Search Replace&#8221; plugin box:<br \/>\r\n<figure>\r\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-97\" src=\"https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-activate.png\" alt=\"\" width=\"833\" height=\"312\" srcset=\"https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-activate.png 833w, https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-activate-300x112.png 300w, https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-activate-768x288.png 768w\" sizes=\"auto, (max-width: 833px) 100vw, 833px\" \/><\/figure>\r\n<\/figure>\r\n<\/li>\r\n<li>Now, as the plugin is active.\u00a0From the menu in the left hand side bar &#8211; click on <strong>Tools &gt; Better Search and Replace<\/strong> as in the image below:<br \/>\r\n<figure>\r\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-98\" src=\"https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-tools.png\" alt=\"\" width=\"400\" height=\"261\" srcset=\"https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-tools.png 400w, https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-tools-300x196.png 300w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/figure>\r\n<\/figure>\r\n<\/li>\r\n<li>In the page that appears &#8211; enter &#8220;http:\/\/&#8221; for &#8220;Search for&#8221; and &#8220;https:\/\/&#8221; for &#8220;Replace with&#8221;. You can just select &#8220;wp2m_postmeta&#8221; or simply select all if it&#8217;s just an abandoned website and the links may have also been in the options table. Please note &#8220;wp2m_&#8221; might just be &#8220;wp_&#8221; or any other format as you set them. You can click on &#8220;Run as dry run?&#8221; to just review it or uncheck it to just action. For the demonstration here, we&#8217;ll leave the option unchecked. Click on &#8220;Run Search\/Replace&#8221; to execute the changes.<br \/>\r\n<figure>\r\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-99\" src=\"https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-action-1024x877.png\" alt=\"\" width=\"1024\" height=\"877\" srcset=\"https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-action-1024x877.png 1024w, https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-action-300x257.png 300w, https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-action-768x658.png 768w, https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-action.png 1034w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\r\n<\/figure>\r\n<\/li>\r\n<li>Once it&#8217;s complete &#8211; you&#8217;ll see something like this at the top of the page, which details the actions taken:<br \/>\r\n<figure>\r\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-100\" src=\"https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-after-action.png\" alt=\"\" width=\"705\" height=\"166\" srcset=\"https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-after-action.png 705w, https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/better-search-replace-after-action-300x71.png 300w\" sizes=\"auto, (max-width: 705px) 100vw, 705px\" \/><\/figure>\r\n<\/figure>\r\n<\/li>\r\n<li>\r\n<p>Congratulations! You&#8217;ve successfully updated all your http URLs to https. For the test website, it looked like this after the changes were made:<\/p>\r\n<figure class=\"wp-block-image\">\r\n<figure><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"143\" class=\"wp-image-102\" src=\"https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/craig-mixed-content-pass-1024x143.png\" alt=\"\" srcset=\"https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/craig-mixed-content-pass-1024x143.png 1024w, https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/craig-mixed-content-pass-300x42.png 300w, https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/craig-mixed-content-pass-768x107.png 768w, https:\/\/babal.host\/blog\/wp-content\/uploads\/2020\/01\/craig-mixed-content-pass.png 1204w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\r\n<\/figure>\r\n<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<p>Next, if you want to know <a href=\"\/blog\/how-to-automatically-redirect-http-traffic-to-https\">how to force HTTPS<\/a> to your website, please visit the following <a href=\"https:\/\/babal.host\/blog\/how-to-automatically-redirect-http-traffic-to-https\/\">URL<\/a>.<\/p>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>Have you ever faced an issue with forcing HTTPS on your website as there are still some insecure links that are being loaded? If so, keep reading further as we have got the fitting solution for you. In the following post, we&#8217;ll look into how we can replace all the links in the WordPress database [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":103,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"class_list":["post-93","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-babal-guide"],"_links":{"self":[{"href":"https:\/\/babal.host\/blog\/wp-json\/wp\/v2\/posts\/93","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/babal.host\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/babal.host\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/babal.host\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/babal.host\/blog\/wp-json\/wp\/v2\/comments?post=93"}],"version-history":[{"count":22,"href":"https:\/\/babal.host\/blog\/wp-json\/wp\/v2\/posts\/93\/revisions"}],"predecessor-version":[{"id":1282,"href":"https:\/\/babal.host\/blog\/wp-json\/wp\/v2\/posts\/93\/revisions\/1282"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/babal.host\/blog\/wp-json\/wp\/v2\/media\/103"}],"wp:attachment":[{"href":"https:\/\/babal.host\/blog\/wp-json\/wp\/v2\/media?parent=93"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/babal.host\/blog\/wp-json\/wp\/v2\/categories?post=93"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/babal.host\/blog\/wp-json\/wp\/v2\/tags?post=93"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}