How to Install an SSL Certificate on WordPress: Configure HTTPS and Fix Errors
From issuing a certificate to checking pages, fixing Mixed Content, configuring redirects, automatic renewal, and safely migrating without losing your site.


1. Why WordPress Needs an SSL Certificate
WordPress is a content management system, while an SSL/TLS certificate is part of the infrastructure that lets a browser establish a secure HTTPS connection. The certificate is not “embedded” in WordPress pages, posts, or themes: it is usually installed on the web server, hosting platform, or CDN through which visitors access the site. So the right sequence starts with the server, not with installing a plugin.
HTTPS is needed not only for online stores. Even a regular blog transmits administrator passwords, session cookies, and data entered into forms. Over HTTP, this information can be intercepted or modified in transit between the user’s device and the server. TLS protects data in transit and lets the browser verify that the connection is to a server presenting a certificate for the correct domain.
A secure connection icon does not mean that the site has automatically become secure in every respect. A vulnerable theme, infected plugin, or weak password remains a problem even with perfectly configured HTTPS. A certificate addresses a specific issue: it protects the network connection and confirms the server’s right to use the domains listed in the certificate.
2. How to Determine Where to Install the Certificate
First, determine where WordPress is actually hosted. The domain may be registered with one registrar, DNS may be managed by another provider, and the site may run with a third. SSL is configured where the HTTPS connection terminates: on the hosting platform, VPS, load balancer, or external proxy.
On standard shared hosting, you can often issue a free DV certificate from the control panel. For WordPress on your own VPS, you will need to configure Nginx, Apache, Caddy, or a control panel. WordPress.com sites work differently: the service manages certificates itself. Do not apply instructions for self-hosted WordPress.org to WordPress.com without first checking how the domain is connected.
If you use Cloudflare or another CDN, check both connections: browser to CDN and CDN to origin server. HTTPS in the browser does not prove that the second connection is encrypted. Choose a mode that verifies the origin server’s certificate, in accordance with the CDN’s capabilities.
3. Preparation: Backups and URLs to Check
Before starting, save the WordPress files, database, file wp-config.php and current web server rules. The backup must be restorable: a ZIP archive without the database will not restore posts, settings, or users. For a large store, it is safer to make changes on a copy of the site first and choose a time with the lowest traffic.
Make a short list of URLs to check: the home page, several internal pages, the admin area, contact form, checkout page, XML sitemap, images, and analytics scripts. Check these separately: example.ru and www.example.ru. A certificate may cover only one of them if the other was not included when it was issued.
It is useful to record the current state: which URL is used in WordPress settings, whether HTTP → HTTPS and www → non-www redirects are in place, whether password recovery works, and where the cache is located. Each of these details affects the outcome. Switching to HTTPS should be a protocol change, not a thoughtless overhaul of the entire site at the same time.
- Verified that the files and database can be restored from the backup.
- The primary site URL and its www version are known.
- Access to DNS and hosting settings is available.
- A method for checking HTTPS on the server has been determined.
- A list of important pages to check has been prepared.
4. DNS and URLs: What to Check Before Issuing an SSL Certificate
To issue a certificate, the certificate authority verifies control of the domain name. With HTTP-01 validation, a request to a special URL must reach the correct server. If the A record points to an old IP, validation will fail. DNS-01 validation uses a TXT record and can be more convenient for Wildcard certificates or infrastructure where port 80 is unavailable.
nslookup example.ru
nslookup www.example.ru
# Если установлен dig:
dig +short example.ru A
dig +short example.ru AAAA
Do not forget about IPv6. A site may respond correctly over IPv4 but present someone else’s certificate through an AAAA record. If DNS is managed by a CDN, results may naturally point to its addresses. In that case, certificate issuance must account for the specific CDN’s rules rather than assume that all requests go directly to the VPS.
Checking DNS does not mean changing records “at random.” Changing an address without understanding the site setup can disable email, subdomains, and internal services. For HTTPS installation, simply make sure the domain points to the place where domain ownership will be validated and the connection will be served.
5. Free Certificate: When Let’s Encrypt Is Enough
A free Let’s Encrypt DV certificate is suitable for most blogs, service websites, corporate pages, and stores. It verifies control of the domain and provides standard TLS encryption. Paid OV and EV certificates involve additional organization checks, but paying for a certificate does not, by itself, make the keys or algorithms more robust.
On managed hosting, you can often just select a domain and enable certificate issuance. If the control panel offers automatic renewal, make sure the feature is enabled for the selected domain and all name variations. Never place a private key on public pages or send it to support through a public form.
A common option for VPS is Certbot. The commands below are for Debian/Ubuntu with Nginx installed and correctly configured. Do not run them mechanically on a server with a different environment: you first need DNS, an active virtual host, network access, and a backup of the configuration.
sudo apt update
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d example.ru -d www.example.ru
sudo certbot renew --dry-run
If you use Apache, the corresponding plugin is usually called python3-certbot-apache, and the issuance command is sudo certbot --apache -d example.ru. The resulting certificate files belong on the server; WordPress will work over HTTPS only after the server is configured correctly and the URLs are updated.
6. How to Check the Certificate Before Changing WordPress
Before fixing links in the WordPress database, check HTTPS itself. Open https://example.ru. The page should load without warnings, and the certificate must be valid and include the correct domain name in the Subject Alternative Name field. Also check the www address if the site uses it or redirects it to the primary address.
An external check should not be limited to a green icon in a mockup. A lock icon in an article or screenshot does not prove that a certificate is installed on the real domain. Check the certificate, trust chain, expiration date, supported TLS versions, and whether there are any name errors.
curl -I https://example.ru/
curl -I http://example.ru/
# Диагностика сертификата, если есть openssl:
openssl s_client -connect example.ru:443 -servername example.ru </dev/null
Command curl -I helps show the HTTP response, but it does not check the entire site by itself. The second command is used later to confirm that HTTP redirects correctly to HTTPS. A temporary error before changing WordPress is a reason to revisit the server settings, not to install an “SSL fix” plugin.
7. Switching the WordPress URL to HTTPS
Once HTTPS is working, open Settings → General. A standard single WordPress installation has two important fields here: “WordPress Address (URL)” and “Site Address (URL).” The first refers to the location of the WordPress core files; the second is the address visitors use to access the site. For a simple installation, these two values are usually the same.
If the previous URL was http://example.ru, change the primary address to https://example.ru. These fields usually do not need a trailing slash. In some setups, WordPress is installed in a subdirectory while the public site is in the root: in that case, the URLs may differ, so do not blindly make them identical.
Clicking “Save Changes” may end your login session. This is normal when changing the address and cookies. If needed, log in again over HTTPS. If the fields cannot be edited, the values may be set using the constants WP_HOME and WP_SITEURL in wp-config.php or managed by the environment.
define('WP_HOME', 'https://example.ru');
define('WP_SITEURL', 'https://example.ru');
The code shown is an alternative to using the control panel, not an additional required step. It fixes the URLs in the configuration: they may then no longer be editable in the interface. Before changing wp-config.php , save the original and check the file’s syntax.
8. Redirecting HTTP to HTTPS Without Loops
Visitors who open the old address should now be sent to the secure version. A 301 or 308 redirect is usually used for a permanent move. Choose one layer to manage it—the web server, hosting panel, or CDN. Multiple independent rules may conflict and create an infinite loop.
For Apache with mod_rewrite a rule in .htaccessmay be used. This is shown only for a typical installation without additional proxies; before replacing the file, save the existing one, which may contain important WordPress and third-party plugin rules.
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
For Nginx, the redirect is usually placed in a separate server block that listens on the HTTP port. The example below shows the principle, not a complete configuration file ready for every server:
server {
listen 80;
server_name example.ru www.example.ru;
return 301 https://example.ru$request_uri;
}
On a VPS, apply the rule only after checking the configuration and, if necessary, reloading Nginx. On managed hosting, it is better to use the built-in “HTTPS/redirect” feature first and avoid adding a second copy of the rule. For a site behind a CDN, find out how the server detects the original connection protocol; otherwise, a loop can occur even if the redirect is technically correct.
9. Why Mixed Content Occurs on WordPress
Mixed content occurs when the main page loads over HTTPS, but contains links to resources over HTTP. These may include images from older posts, theme CSS files, scripts, fonts, videos, iframes, embedded maps, or external widgets. Modern browsers try to automatically switch some resources to HTTPS and block others. As a result, after a certificate is installed, the site can sometimes look “broken.”
In practice, the problem often appears after a site is migrated from HTTP, when absolute URLs like these remain in the database http://example.ru/wp-content/uploads/.... Another possibility is that a plugin or theme hard-coded an HTTP URL directly into a template. A third is that an external service does not provide HTTPS, so its content cannot be loaded securely.
Do not assume the warning has gone away for good just because the browser automatically changed the scheme of an image. This behavior depends on the resource type and browser version. The right fix is to update the original URLs and make sure the resources are actually available over a secure protocol. The detailed steps are below.
10. How to Find Insecure Resources in the Browser
Open the problem page, then open developer tools (usually F12) and the Consoletab. Mixed Content messages indicate which URL is being loaded insecurely. In the Network tab, you can look for requests with http://, loading errors, and blocked resources. Run diagnostics on several templates: the home page, post page, product page, cart, forms, and account area.
If the console lists a file http://example.ru/wp-content/uploads/photo.jpg, check whether the corresponding https://address opens and where the old link came from. If the warning is related to a third-party script, look for a secure version of the service or replace the integration. Do not simply replace the text http on https for a third-party domain without checking it: the resource may not exist, and its owner may have changed what the address points to.
For a general audit, you can crawl the site and check its resources, but first exclude account areas, payment pages, and other URLs that require authentication. Fixing Mixed Content must not expose personal data to third-party analysis tools.
11. Safely Replacing Links in the Database: WP-CLI
In WordPress, links can be found not only in post content but also in metadata, widget settings, page builders, and serialized PHP structures. A simple bulk SQL command REPLACE() can damage these values because the length of strings inside a serialized object is recorded separately. It is better to use tools that understand the data format.
WP-CLI supports the command wp search-replace, which correctly handles serialized values. After creating a backup, run a dry run. Example for a standard single-site installation; replace the domain, path, and permissions with the actual values:
wp search-replace 'http://example.ru' 'https://example.ru' --skip-columns=guid --dry-run
# После изучения результата и резервного копирования:
wp search-replace 'http://example.ru' 'https://example.ru' --skip-columns=guid
--dry-run shows potential changes without writing to the database. The parameter --skip-columns=guid usually helps avoid affecting post IDs that are not meant to be included in this bulk replacement. WordPress Multisite uses a different approach: you need to account separately for networks, domains, and the command parameters --network; do not use the example above on a multisite installation without adapting it.
On shared hosting without WP-CLI, you can use a specialized migration tool from a trusted source. Before using it, check whether it supports previewing changes, is compatible with your current WordPress version, and whether you have a current backup. After replacing the links, clear the site cache, object cache, CDN cache, and browser cache.
12. Illustrated Guide to Fixing Mixed Content

After checking, it is important to distinguish the source of an error from its symptom. For example, a warning about a background image may be caused by an old CSS file that is still cached on the CDN. Fixing the issue in the WordPress editor will not help while visitors are still being served the old CSS. Similarly, when using a page builder, styles may be generated in separate files. Sometimes, after changing a URL, you need to run the page builder’s built-in CSS regeneration.
Also check srcset, thumbnails, images that open in a modal window, social widgets, and external fonts. The home page may look fine while an error persists in a post’s sidebar or on the cart page. So the final check should cover more than one URL.
13. CDN, Cloudflare, and Reverse Proxy Considerations
When using a CDN, the browser usually connects to its server first. The CDN then requests the page from the origin host. If TLS terminates at the CDN, WordPress may not detect the original HTTPS connection and may incorrectly generate HTTP links or cause redirect loops.
The official WordPress documentation describes a scenario involving the header X-Forwarded-Proto. However, this header must not be trusted unconditionally: it should be set by a managed, trusted proxy, not directly by any visitor. Checking the protocol requires an understanding of the network architecture. For a server behind a correctly configured reverse proxy, wp-config.phpcan be adapted, but only after verifying the source of the headers.
When using Cloudflare, distinguish between the encrypted connection to the client and the connection to the origin server. A mode where HTTPS is used only between the client and the CDN does not fully protect data in transit to the host. A mode with a verifiable certificate on the origin is preferable. The CDN, server redirect, and WordPress settings must be consistent with one another.
After making changes, clear the cache at every layer: plugin cache, server cache, CDN, and browser. Otherwise, you may wrongly conclude that the configuration did not work when the problem is just an old copy of the response.
14. HTTPS Plugins: When They Help and When They Get in the Way
HTTPS migration plugins are useful if you do not have access to the web server or need a temporary way to fix some URLs. But no plugin can make an invalid server certificate valid. If the browser displays a warning before WordPress loads, fix the certificate and hosting configuration, not the plugins.
Extensions that automatically rewrite URLs sometimes hide the source of a problem instead of fixing its cause. When such a plugin is disabled, the old links return. It is preferable to update the URLs and content correctly once, then use tested caching and redirect mechanisms without duplicate rules.
Before installing an extension, check its compatibility with WordPress, the number of active installations, its update history, and the permissions it requests. Do not install multiple plugins that change redirects and HTTPS settings at the same time. After migration, it is useful to make a list of the components involved so you know which system manages SSL and which component handles URLs.
15. Configuring HTTPS in WooCommerce and Forms
If your WordPress site uses WooCommerce, the transition is not complete until you have checked the cart, checkout, order confirmation emails, and payment integrations. Do not use real bank card details in an unverified environment during testing. Instead, use the connected payment service’s test mode and make sure its webhooks, callback URLs, and allowlists do not point to the old protocol.
Contact forms and service booking forms sometimes send data to external HTTP handlers. HTTPS in the main site’s address bar does not protect such a request if the information is then sent to an insecure endpoint. Check the form submission URL, attachment security, anti-spam measures, and data retention policy.
When logging in over HTTPS, cookies should have the necessary flags, including Secure for sensitive sessions. The settings themselves depend on the platform and integrations. If users are frequently logged out after migration, do not immediately disable cookie security: first check the cookie domain, URL scheme, caching of authenticated pages, and network headers.
16. SEO After Migration: Indexing and Internal Links
HTTP and HTTPS are different URL variants. To avoid duplicates and maintain a clear structure, choose one canonical protocol and one primary domain variant, with or without www. All old URLs should redirect to their corresponding new pages with a stable redirect, rather than sending every internal page to the home page.
On internal pages, update canonical, Open Graph URLs, addresses in the XML sitemap, menu links, images, and structured data. Check the robots.txt file for sitemap links and crawl rules. After migration, submit the updated sitemap to Yandex Webmaster and Google Search Console if you use these services.
HTTPS alone does not guarantee better rankings: search engines care about content, page availability, and the absence of technical errors. Incorrect redirect chains, blocked critical CSS, mass 404 errors, and redirect loops can harm traffic more than missing additional TLS settings. For large projects, compare the lists of old and new URLs and check the response for each one.
After migration, regularly review indexing error reports and traffic statistics. With a successful migration, search engines gradually update URLs in the index, but the exact speed depends on the site itself and how often it is crawled.
17. Common Errors After Installing SSL
When troubleshooting, first identify which layer the problem is at. If the browser cannot establish an HTTPS connection at all, WordPress is not yet involved in handling the request. If HTTPS works but styles do not load, troubleshoot the pages and resources. This approach saves time and prevents the needless installation of additional plugins.
18. Automatic Renewal, Monitoring, and HSTS
Even a correctly installed certificate has a limited validity period. On managed hosting, the provider usually handles automatic renewal, but that does not eliminate the need to monitor it. Changes to DNS, hosting migrations, or a disabled domain can cause the process to fail. On a VPS, check the Certbot system timer or another ACME client, run a renewal test, and configure a notification for an approaching expiration date.
sudo certbot renew --dry-run
# Для проверки ответа сервера:
curl -I https://example.ru/
HSTS tells the browser to connect to the domain only over HTTPS. This is a useful mechanism, but enabling includeSubDomains prematurely preload can disable subdomains that are not yet ready for HTTPS. Add the parameter only after fully checking the entire domain space and understanding the consequences. The certificate, redirects, third-party services, and automatic renewal must all be working before considering a long-term HSTS policy.
Regular audits include checking that the WordPress core, themes, and plugins are up to date, backups are available, error logs are reviewed, TLS settings are correct, and expiring certificates are handled. HTTPS is part of overall security, not a one-time task.
19. Post-Migration Site Checklist
- The site opens over
https://without browser warnings. - The certificate covers the primary domain and the www variant in use.
- The correct site and installation URLs are set in WordPress.
- HTTP redirects to HTTPS with as few redirects as possible.
- The home page, posts, pages, images, forms, and search work.
- There are no Mixed Content errors in the Console on key templates.
- Styles, images, and scripts are available over HTTPS.
- Login and password recovery work correctly.
- The sitemap, canonical URLs, and internal links use the primary protocol.
- If you have a store, test the cart, payment in test mode, and notifications.
- Automatic renewal has been checked, and an expiration-date reminder has been set.
- A backup and a plan for reverting to the previous configuration have been saved.
Once these items are complete, the main migration can be considered finished. However, it is useful to check the site again after a few days: some caches and external integrations do not update immediately. For high-traffic projects, check monitoring reports and actual pages, not just an external SSL scanner.
20. Frequently Asked Questions About SSL in WordPress
Do I need to buy paid SSL for WordPress?
For standard HTTPS, a free DV certificate is often sufficient. Paid OV/EV certificates are appropriate if you need additional organization verification or commercial terms, but they do not replace regular updates and site security.
Can I enable HTTPS using only a plugin?
No. The certificate must be available on the server or service that accepts HTTPS connections. A plugin can help with URLs and some settings, but it does not replace a working TLS configuration.
Why won't WordPress open after I change the URL?
Possible causes include certificate errors, an incorrect address in the settings, incorrect redirect rules, working through a proxy, and cookie issues. Start troubleshooting by checking HTTPS and the backup, then verify the values home and siteurl.
What should I do if the browser blocks scripts?
Open the Console and find the HTTP resource. If the script has an official HTTPS address, update the link. If there is no secure version, discontinue the integration or replace it.
Is it necessary to use HSTS right away?
No. First, HTTPS must be stable on all required names, and the certificates must be working. HSTS errors can sometimes be harder to fix because the browser remembers the policy for a set period.
Will the site be faster after SSL?
HTTPS does not guarantee faster performance. Speed depends on the server, caching, images, scripts, and use of modern protocols. The switch from HTTP to HTTPS should primarily be viewed as improving connection security.
21. Sources and Additional Instructions
This article uses official WordPress and MDN reference documents. Specific hosting control panel item names vary by plan and panel version; consult your provider's documentation for them.
- WordPress Developer Resources — Migrating WordPress, changing URLs
- WP-CLI — search-replace, dry-run, and serialized data
- WordPress — HTTPS and reverse proxies
- MDN — Mixed Content, request types, and troubleshooting
- WordPress — Site Health Check
- MDN — HTTP Strict Transport Security
Related articles: issuing a free Let's Encrypt certificate, enabling SSL on Beget, SSL on REG.RU, HTTPS basics.
Additional guides
Other articles can help you verify certificate installation and understand HTTPS configuration.
SSL Basics · Let’s Encrypt Installation · Mixed Content Error