Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Properly Move WordPress from HTTP to HTTPS (Beginner’s Guide)

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

Are you looking to move WordPress from HTTP to HTTPS and install an SSL certificate on your website?

We have received a lot of requests on this topic because Google announced back in July 2018 that the Chrome browser will mark all websites without SSL as insecure.

In this article, we will show you how to properly move WordPress from HTTP to HTTPs by adding a SSL certificate.

Moving WordPress from HTTP to HTTPS / SSL

Don’t worry, if you have no idea what SSL or HTTPS is. We’re going to explain that as well.

What is HTTPS?

HTTPS or Secure HTTP is an encryption method that secures the connection between users’ browser and your server. This makes it harder for hackers to eavesdrop on the connection.

Every day, we share our personal information with different websites, whether making a purchase or simply logging in.

To protect the data transfer, a secure connection needs to be created.

That’s when SSL and HTTPS come in.

Each site is issued a unique SSL certificate for identification purposes. If a server is pretending to be on HTTPS, and its certificate doesn’t match, then most modern browsers will warn the user from connecting to the website.

Connection not private error in Google Chrome

Now, you are probably wondering why I need to move my WordPress site from HTTP to HTTPS, especially if it’s a simple blog or small business website that doesn’t collect any payments.

Why do you need HTTPS and SSL?

In 2018, Google announced a plan to improve overall web security by encouraging website owners to switch from HTTP to HTTPS. As part of this plan, their popular Chrome web browser would mark all websites without an SSL certificate as “Not Secure.”

Connection not secure

Google also said that websites with SSL will also see SEO benefits and will get higher search rankings than insecure websites. Since then, a large number of websites have switched from HTTP to HTTPS.

After the announcement, Google started rolling out the “Not Secure” warning in Chrome. For example, if someone visits an HTTP website using the incognito window, it will be marked as Not Secure. If someone visits an HTTP website in regular mode and tries to fill out a contact form or another form, then the website will be marked as insecure.

When your readers and customers see this notice, it gives them a bad impression of your business.

This is why all websites need to move from HTTP to HTTPS and install SSL immediately.

Not to mention, if you want to accept payments online on your eCommerce website, you need SSL.

Most payment companies, like Stripe, PayPal Pro, Authorize.net, etc., will require a secure connection before accepting payments.

We use SSL for our websites, including WPBeginner, OptinMonster, WPForms, and MonsterInsights.

Requirements for using HTTPS/SSL on a WordPress Site

The requirements for using SSL in WordPress are not very high. All you need to do is purchase an SSL certificate, and you might already have it for free.

The best WordPress hosting companies are offering free SSL certificates for all their users:

For more details, see our guide on how to get a free SSL certificate for your WordPress website.

If your hosting company does not offer a free SSL certificate, then you’ll need to purchase an SSL certificate.

We recommend using Domain.com because they offer the best SSL deal for both regular and wildcard SSL certificates.

By purchasing a SSL certificate from them, you also get a TrustLogo site seal for your website, and each SSL certificate comes with a minimum of $10,000 security warranty.

Once you have purchased an SSL certificate, you will need to ask your hosting provider to install it for you.

Setting up WordPress to Use SSL and HTTPs

After you have enabled an SSL certificate on your domain name, you will need to set up WordPress to use SSL and HTTPs protocols on your website.

We will show you two methods to do that, and you can choose one that best fits your need.

Video Tutorial

Subscribe to WPBeginner

If you’d prefer written instructions, just keep reading

Method 1: Setup SSL/HTTPS in WordPress Using a Plugin

This method is easier and is recommended for beginners.

First, you need to install and activate the Really Simple SSL plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you need to visit the Settings » SSL page. The plugin will automatically detect your SSL certificate, and it will set up your WordPress site to use HTTPs.

SSL enabled on a WordPress website

The plugin will take care of everything, including the mixed content errors. Here’s what the plugin does behind the scenes:

  • Check SSL certificate
  • Set WordPress to use https in URLs
  • Set up redirects from HTTP to HTTPs
  • Look for URLs in your content still loading from insecure HTTP sources and attempt to fix them.

Note: The plugin attempts to fix mixed content errors by using output buffering technique. It can have a negative performance impact because it’s replacing content on the site as the page is being loaded. This impact is only seen on first-page load, and it should be minimal if you are using a caching plugin.

While the plugin says you can keep SSL and safely deactivate the plugin, it’s not 100% true. You will have to leave the plugin active at all times because deactivating the plugin will bring back mixed content errors.

Method 2: Setup SSL/HTTPS in WordPress Manually

This method requires you to troubleshoot issues manually and edit WordPress files. However, this is a permanent and more performance optimized solution. This is what we’re using on WPBeginner.

If you find this method difficult, then you can hire a WordPress developer or use the first method instead.

As part of this method, you may need to edit the WordPress theme and code files. If you haven’t done this before, then see our guide on how to copy and paste code snippets in WordPress.

First, you need to visit Settings » General page. From here you need to update your WordPress and site URL address fields by replacing http with https.

Update WordPress URLs

Don’t forget to click on the ‘Save changes’ button to store your settings.

Once the settings are saved, WordPress will log you out, and you will be asked to re-login.

Next, you need to set up WordPress redirects from HTTP to HTTPS by adding the following code to your .htaccess file:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

If you are on NGINX servers, then you would need to add the following code to redirect from HTTP to HTTPS in your configuration file:

server {
listen 80;
server_name example.com www.example.com;
return 301 https://example.com$request_uri;
}

Don’t forget to replace example.com with your domain name.

By following these steps, you will avoid the WordPress HTTPS not working error because WordPress will now load your entire website using https.

If you want to force SSL and HTTPS on your WordPress admin area or login pages, you need to configure SSL in the wp-config.php file.

Add the following code above the “That’s all, stop editing!” line in your wp-config.php file:

define('FORCE_SSL_ADMIN', true);

This line allows WordPress to force SSL / HTTPs in the WordPress admin area. It also works on WordPress multisite networks.

Once you do this, your website is fully set up to use SSL / HTTPS, but you will still encounter mixed content errors.

These errors are caused by sources (images, scripts, or stylesheets) that are still loading using the insecure HTTP protocol in the URLs. If that is the case, then you will not be able to see a secure padlock icon in your website’s address bar.

Not secure

Many modern browsers will automatically block unsafe scripts and resources. You may see a padlock icon but with a notification about it in your browser’s address bar.

Insecure content blocked

You can find out which content is served through insecure protocol by using the Inspect tool. The mixed content error will be displayed as a warning in the console with details for each mixed content item.

Mixed content errors displayed in browser console

You will notice that most URLs are images, iframes, and image galleries while some are scripts and stylesheets loaded by your WordPress plugins and themes.

Fixing Mixed Content in WordPress Database

The majority of the incorrect URLs will be images, files, embeds, and other data stored in your WordPress database. Let’s fix them first.

All what you need to do is find all mentions of your old website URL in the database that started with http and replace it with your new website URL that starts with https.

You can easily do this by installing and activating the Better Search Replace plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, you need to visit Tools » Better Search Replace page. Under the ‘Search’ field, you need to add your website URL with http. After that, add your website URL with https under the ‘Replace’ field.

Search and replace

Below that, you will see all your WordPress database tables. You need to select all of them to run a thorough check.

Lastly, you need to uncheck the box next to the ‘Run as dry run?’ option and then click the ‘Run Search/Replace’ button.

The plugin will now search your WordPress database for URLs starting with http and replace them with secure https URLs. It may take a while, depending on your WordPress database size.

Fixing Mixed Content Errors in WordPress Theme

Another common culprit causing mixed content errors is your WordPress theme. Any decent WordPress theme following WordPress coding standards will not cause this issue.

First, you will need to use your browser’s Inspect tool to find the resources and where they are loading from.

Using inspect tool to find mixed content error

After that, you will need to find them in your WordPress theme and replace them with https. This will be a little difficult for most beginners, as you will not be able to see which theme files contain these URLs.

Fixing Mixed Content Errors Caused by Plugins

Some mixed content resources will be loaded by WordPress plugins. Any WordPress plugin following WordPress coding standards will not cause mixed content errors.

We don’t recommend editing WordPress plugin files. Instead, you need to reach out to the plugin author and let them know. If they do not respond or are unable to fix it, then you need to find a suitable alternate.

Note: If for some reason, you’re still encountering mixed content error, then we recommend using the Really Simple SSL plugin temporarily, so your users are not impacted while you fix the issue on a staging website or hire a developer.

Submit Your HTTPS Site to Google Search Console

Search engines like Google consider https and http as two different websites. This means you will need to let Google know that your website has moved to avoid any SEO issues.

To do that, you just need to go to your Google Search Console account and click on ‘Add a Property’ button.

Add property

This will bring up a popup where you need to add your website’s new https address.

There are two methods for site verification: domain name or URL prefix. We recommend the URL prefix method because it is more flexible.

Add website URL in Google Search Console

After that, Google will ask you to verify ownership of your website.

There are several ways to do that. Select any method, and you will get instructions to verify your site. We recommend using the HTML tag method.

HTML tag method to verify your site

You will now see an HTML code snippet that you need to head section of your WordPress website.

Add Search Console Verification Code using All in One SEO

First, install and activate the All in One SEO for WordPress plugin. For more details, see our tutorial on how to install a WordPress plugin.

Note: There is also a free version of All in One SEO that you can try.

Upon activation, go to the All in One SEO » General Settings page and click on Google Search Console.

Add Google Search Console verification code in All in One SEO

Below that, you need to add the verification code you copied earlier from Google Search Console website.

Don’t forget to click on the Save Changes button to store your settings.

Next, switch back to the Google Search Console tab and click the Verify button.

Verify ownership

Once your site is verified, Google will show your search console reports here.

You also need to ensure that both the https and http versions are added to your Search Console.

This tells Google that you want the https version of your website to be treated as the primary version. Combined with the 301 redirects that you set up earlier, Google will transfer your search rankings to the https version of your website, and you will most likely see improvements in your search rankings.

We hope this article helped you add HTTPS and SSL in WordPress. You may also want to see our ultimate WordPress security guide with step-by-step instructions to keep your WordPress site secure or our expert picks of the best analytics solutions for WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

406 CommentsLeave a Reply

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Raul says

    Hi,

    I’m in a predicament due to lack of knowledge and Google. My website is currently ranked # 2 in Google for a particular organic keyword. I ordered a SSL from my hosting company and I received confirmation that the SSL is ready to be used. I would like to use the SSL on every page in my site including the shopping cart but I don’t want to lose the #2 ranking in Google by not converting to SSL properly. Your advice will be appreciated.

    Raul

  3. Jonathon Fowler says

    Hi there,

    Great article. One question, I read that using a wildcard redirect will have a negative impact on SEO – is this correct? The articel says ranking will drop using a wildcard redirect.

    I have thousands if images on my site using http in the url…using yur redirect would direct all images to the new https?

    Thanks !

  4. dylan says

    Hi,

    I love your site – lots of good stuff here.

    I’m wondering if you can recommend a wordpress security plug-in that you know for sure plays friendly (without too much hassle) with full site SSL / HTTPS.

    My site is covered already (every page) but I’m worried about installing a plug-in that may interfere.

    Any suggestions would be much appreciated.

    Cheers

  5. Joe says

    Will changing the Site URL in WordPress to “HTTPS” auto redirect any HTTP requests?

    We don’t need htaccess rewrites if the SITE URL is HTTPS?

  6. Cristi Scutaru says

    Great post, it helped me switch my WordPress site to SSL in just a few minutes!

    Great site as well, congrats for such a valuable content. I found myself often googling for some WordPress related answers for the past few days, and your pages came on top frequently, with clear and concise solutions.

  7. Piet says

    When only switching the WP backend to SSL, the next challenge is how to show featured images in the backend? These are loaded via http instead of https and as such do not show in the WP backend anymore.

    Is there a way to load them from https for the backend only or do I just have to accept the fact that I will not be able to see them (in the backend)?

  8. Yuvraj Khavad says

    Hi Team wpbeginner,
    Thanks for this post. You save my time.

    Keep Good Work.

    Thanks
    Yuvraj R K.

  9. Logan says

    Thanks for this great guide to setting up https. Was using the plugin your mentioned for a long time but it caused problems with my site so I only used it to secure my admin panel. Now I can cover my entire site.

  10. Felix Figueroa says

    The .htaccess edit broke my site with the “ERR_TOO_MANY_REDIRECTS” message. Tried suggestions detailed in this post. After disabling all plugins i get a 500 Server Error. Thanks, my site is completely broken now.

  11. beamkiller says

    Dear wpBeginner,

    I have made the modifications in htaccess and Options too but I got error in Chrome:
    ERR_TOO_MANY_REDIRECTS

    So my page is not secured with SSL, on Checkout and My-Account it is working with WooCommerce. But I cannot get to work it on the whole WP installation.

    • MMPrint says

      Hope this helps:

      Uncheck the WooCommerce “Un-force HTTPS when leaving the checkout” setting.

      The htaccess if forcing https but then woocommerce forces http so they just go back and forth in a loop.

      • Chetan says

        Hi MMPrint

        I can give thousand thumbs up to your answer. This has solved my issue which i was living with since the last 10 days. No matter what i tried in the .htaccess file the site wasnt showing up. I also played with deactivating the plugins etc etc. Finally it was woocommerce which was the culprit.

        Thanks a lot man !

        Cheers
        Chetan

  12. Kevin Verlinden says

    I like this site the information is very useful and comprehensive. It has helped me already a lot of times.

      • Austin says

        “We already use SSL for our eCommerce sites like OptinMonster, Soliloquy, and Envira Gallery.”

        I took this to mean all of the pages – wondering if that was the case and now for some reason it has been reverted to non-SSL?

        Thanks!

  13. George says

    I tried this plugin and it broke my site. Uninstalled in immediately. I still need what this plugin offered, which is https on some pages, but not the whole site. Is there any other plugin (other than this one, which hasn’t been updated in over two years) that can do this?

      • Celeste says

        What do you mean, Patrick, that iThemes Security will take care of this. I just went to their website and it seems like a good plugin for enhanced security. But I didn’t see any reference to SSL or setting up specific pages to use SSL only.

  14. Octavio Cestari says

    I did the installation of a plugin which forced all the site enter https, now I can no longer access the site or the wordpress dashboard, how do I reverse the process?

  15. Drew says

    I just added the code using your .htaccess solution. Worked perfectly and exactly as described. A big thank you!

  16. michael s says

    You say all you need to do is buy a certificate, but my hosting service requires a static IP address also which is WAY more expensive than a basic certificate. My service wants $4/month for static IP.

  17. DJ says

    HELP!
    I did this change and now I can’t access my site through WP-ADMIN
    It is stating my site is down. I don;t have an .htaccess file in my files. I have set FileZilla to show hidden files and cannot find it. Can you help me get back into my site?

    Thanks.

  18. Sasha says

    I used the .htaccess method and got this error:

    “The page isn’t redirecting properly

    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    This problem can sometimes be caused by disabling or refusing to accept cookies.”

    Any one has an idea?

    thanks

  19. Mike S says

    I added the code into the .htaccess and I got the following issue:

    The page isn’t redirecting properly

    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    This problem can sometimes be caused by disabling or refusing to accept cookies.

  20. Marych says

    PLEASE HELP

    I didn t get a certificate but just went to settings > General and replaced http by https .
    after updating I can t access to my wordpress url and the message ‘ Your connection is not private

    Attackers might be trying to steal your information from etlco.com.sa (for example, passwords, messages, or credit cards). ‘ is displayed .

    Any solution , please help me

    • Andron says

      You need to get a certificate in order for it to work. When you request a page over https, it starts a conversation between your browser and the server in which the server validates its identity as the correct site. That validation occurs by sending a trusted certificate to your browser. If a certificate doesn’t exist, your browser will give you that “connection is not private” warning. It’s done to protect you from sites that aren’t who they claim to be.

      Namecheap offers basic SSL certificates for $9 a year, and there are plenty of other options. If you can wait, look into LetsEncrypt.org — they’ll be offering free ones starting this September, I think.

    • sewe herbert says

      Hi Marych, just had that same problem, but managed to fix it; here is how

      use an FTP Program, alocate the wp-config.php
      then put this just after (define(‘ABSPATH’, dirname(__FILE__) . ‘/’);)

      define(‘WP_HOME’,’http://yoursite.com’);
      define(‘WP_SITEURL’,’http://yoursite.com’);

      then save and re-upload the wp-config.php file
      Then all is well

  21. Gary Morrison says

    We have did like you said .. and not we are locked out of the dashboard and any page we go to on front end will not display only home page works.

    Thank you for your time ..

    P.S. and now my images are not showing up…

  22. Tom L says

    Thank you very much for your support. I was able to install the plugin and have my site with all pages https without any adjustments.
    Perfect instructions.

  23. Tecnologia Geek says

    can i have some help here.. i dit all this step but..the site look diferent and i cant login to admin..

  24. Maarten says

    It is worth mentioning this technique breaks WooCommerce downloads. It will end in a 403 access denied for forced download or x-sendfile downloadable products.

  25. Matthew says

    Thanks for the excellent article.
    I was under the impression that installing an SSL certificate was as simple as you have indicated… however, when I installed mine it appears to confused (and completely broken) my site. I am being told that some parts of my wordpress database have changed to https, but others haven’t.
    Now I can’t get in to the wordpress admin area at all – but I can ftp to the hosting.
    Any ideas how I can update my wordpress databases and themes to reflect https rather than http ?
    I am tempted to uninstall the certificate, restore my entire site from a backup and wander off, shaking my head in frustration.
    Thanks,
    Matthew

  26. Shane says

    Your article made no mention of verifying plugin compatibility with SSL before making the change. Is that because plugin code generally doesn’t go “offsite” and hence result in “insecure” content warnings, or are plugins something that we should be concerned about and carefully review before considering the switch?

  27. Jim R says

    thank you for this- never used SSL or HTTPS before and suddenly needed a java donations page to be HTTPS. with your instructions I was able to get it working in a matter of minutes.

  28. Jennifer Goddard says

    Don’t download this plug in. As of late 2014 there are multiple complaints of incompatibility!

  29. GJ says

    Thanks for the tutorial.

    I wanted to add a few more resources..

    1) Change all the ur’s media/js etc through the Bluevelvet plugin from http to https

    2) if you do not have the green https color you can look for insecure files at whynopadlock.com

    3) Submit your https version to the webmaster tools as well

  30. Ollie says

    Excellent tips as always.

    I’d like to point out for anyone using the .htaccess redirect, to include that in their htacces file first at the top. I had the usual wordpress htaccess code at the top of the file and it wasn’t working until I pasted the new code before it.

  31. Rael says

    hi guys,

    I have an http link which cannot be changed using //www.url.com/ because the server it’s on doesn’t have SSL.

    The issue comes when this link appears on a secure page on my site.

    Is there a way to redirect it to http once off the https page?

  32. Muhammad Umer says

    Hi Syed i really need your help in this, some plugin causing this i added this today more than 5 times after few time it remove automatically from htaccess file, i am using w3 total cache.

  33. Muhammad Umer says

    Hi, Thank you for the guide i configured everything perfectly with your guide, but when i empty cache or use w3 total cach plugn they removed my .htaccess file and start their own.
    is there any settings in the plugin?
    currently want to use ssl on
    Thanks,

  34. Mark says

    Hi, the WordPress HTTPS plugin hasn’t been updated in a couple of years. Do you still recommend it?

  35. WPBeginner Staff says

    Your site is making http requests to resources which are not secure. For example many WordPress themes fetch Google fonts using a non-https url. View your site’s source code to figure out which scripts, images, stylesheets are using non-https URLs.

    • Dustin says

      Very helpful. SSL works great on my sites now. The main issue I ran into was securing images. Easy to identify, but time-consuming to fix. It seems all I had to do was reload the same image and it fixed the problem. For sites that have hundreds or more images, is there a plugin or an easier way you’d recommend to fix insecure images? Thank you.

      • Gavin says

        Like Justin, the biggest issue I had was with images. I’m currently running SSL Insecure Content Fixer plugin with the ‘Content’ option checked to resolve this issue, but it’s unsatisfactory to have to have a plugin activated all the time instead of just being able to apply a change from http to https to images across the board (perhaps other media types too? – I haven’t check this). Is there a way to apply a universal permanent change? Thanks.

  36. Travis Pflanz says

    One of the biggest culprits of elements not being loaded over HTTPS is a theme calling Google Fonts. Unfortunately, many theme developers call the Google font with http://, rather than just //

Leave a Reply to RichPat Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WPBeginner Assistant
How can I help you?

By chatting, you consent to this chat being stored according to our privacy policy and your email will be added to receive weekly WordPress tutorials from WPBeginner.