How to setup HTTPS on Wordpress?

This article describes basic steps to make your Wordpress website work via a secure web protocol, as well as the main methods which can be used to get rid of insecure content in order to display a green padlock in browsers.

One of the key steps in ensuring that your WordPress site is secure is activating and installing a valid SSL certificate. This will enable users to exchange information with your site via secure, encrypted transfer protocols.

In order to make the changes work in Wordpress, you will need to adjust your WordPress Address (URL) and Site Address (URL) accordingly (https://example.com). Follow the steps below:

1) Access your Wordpress in your control panel.

http://helpdesk.ssls.com/hc/en-us/article_attachments/204271185/https_wp_01.jpg

2) Locate the link to access your Wordpress admin panel.

http://helpdesk.ssls.com/hc/en-us/article_attachments/204271195/https_wp_02.jpg

 3) Open or Login to your Wordpress admin dashboard.

http://helpdesk.ssls.com/hc/en-us/article_attachments/204271225/https_wp_03.jpg

4) In the Settings menu, click General.

http://helpdesk.ssls.com/hc/en-us/article_attachments/204271215/https_wp_04.jpg

5) Add https:// before Wordpress Address and Site Address URLs.

6) Once done, don’t forget to save your changes.

http://helpdesk.ssls.com/hc/en-us/article_attachments/204235149/https_wp_05.jpg

From now on, all your WordPress website pages should be accessible via https:// connection.

Now the links will automatically redirect to https://.

http://helpdesk.ssls.com/hc/en-us/article_attachments/204271175/https_wp_06.jpg

This process can be done either by manually editing Wordpress inner redirect structure (however, this is not recommended), or by installing one of HTTPS plugins used for such purposes.

Note: If you choose to edit Wordpress structure manually, the following script can be used: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

(a detailed description of how to implement it is listed in the link above).

We strongly recommend creating a backup of the database before making any changes.

The HTTPS plugin can be installed in Wordpress administrative panel: Plugins => Add New.

(In the example shown, we use Easy HTTPS Redirection, a plugin used to make all pages accessible via https://.)

Once the plugin is downloaded and activated, use the following steps:

1) Select Installed Plugins in the left-side menu.

2) Locate the Settings of the plugin you wish to install.

http://helpdesk.ssls.com/hc/en-us/article_attachments/204235159/https_wp_07.jpg

3) In the Settings section, check the following boxes:

  • Automatic Redirection to “HTTPS”;
  • Force Resources to use HTTPS Redirect.

4) Click Save Changes.

http://helpdesk.ssls.com/hc/en-us/article_attachments/204235169/https_wp_08.jpg

Once done, your Wordpress website will be accessible via https://.

If you still get the “This page contains both secure and non-secure data” error, refer to this article.

By default, WordPress installation does not contain insecure links and content, the issue may be caused within the theme. To correct this issue, locate the insecure links in theme scripts and replace them with secured ones ( https://) .

If you don’t know where these links are located, you can use search cron command below or run the same command in Command Line Interface via SSH:

grep -r "http://" /home/cPuser/public_html/ > /home/cPuser/report.txt

(make sure to replace cPuser with your actual cPanel username)

NOTE: Keep in mind that setting up a cron job to run with the interval of less than 15 minutes may cause account resource overuse.

When the research is complete, you can check the report.txt file where all scripts/files containing insecure http:// links are specified. Below you can find an example of the output:

... /home/nctest/public_html/wp-content/themes/thbusiness/options.php:
'std' => 'http://www.google.com/+Themezhutthemes',

  /home/nctest/public_html/wp-content/themes/thbusiness/languages/readme.txt:http://codex.wordpress.org/Function_Reference/load_theme_textdomain

/home/nctest/public_html/https/wp-content/themes/thbusiness/functions.php: wp_register_style('googleWebFonts', 'http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic');...

As you can see, all results remain non-filtered, which means that non-related lines will be presented as well. You will need to either enhance the search command with regular expressions for a more precise search or look through the results as they are shown.

In raw results, the insecure link to fonts can be located:

http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic

You should change it to:

https://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic

In /wp-content/themes/thbusiness/functions.php file.

Important:

  • We suggest backing up the original file so you may restore it later if needed, as not every link will work after the changes to https:// take place.
  • You can also use plugins (e.g. SSL Insecure Content Fixer) for updating CSS and JavaScript http:// links. Frequently used plugins can be found at:

https://wordpress.org/plugins/wordpress-https/

https://wordpress.org/plugins/ssl-insecure-content-fixer/

https://wordpress.org/plugins/really-simple-ssl/

If the issue persists, we recommend rechecking if any active plugin/extension/theme/template is causing the issue and if so, contact its developer for assistance with https:// implementation.

Powered by Zendesk