search
HomeCMS TutorialWordPressHow to enable https in wordpress
How to enable https in wordpressJul 12, 2019 pm 04:55 PM

How to enable https in wordpress

At present, https is the general trend. Baidu and Google have stated that pages using https protocol are more secure and will be given priority in rankings. Life is endless and the tossing is endless. Let’s share the entire WordPress site. Enable https to access practical tutorials.

1. Apply for an SSL certificate

To enable https on a website, you must first configure an SSL certificate, but the key point is to first have an SSL certificate. Initially, because SSL certificates are expensive, many personal webmasters will If you choose to give up using HTTPS, domestic Alibaba Cloud, Tencent Cloud, and Qiniu now have free certificates that you can apply for.

2. Install the SSL certificate

After we successfully apply for the SSL certificate, download and decompress the certificate file. They are the certificate files of Apache, IIS, and Nginx servers. Tencent Cloud officially gave us Examples of 4 types of server certificate installation methods are provided. The tutorial is very detailed and we can refer to it: SSL Certificate Installation Guide

WordPress Website Configuration

1. Enter In the WP backend, go to Settings-General and change the WordPress address (URL) and site address (URL) to: https.

How to enable https in wordpress

#2. Force SSL to be turned on during login and background.

By modifying the WP-config.php file, add the following two lines of code directly at the end of the file:

/* 强制后台和登录使用 SSL */
define('FORCE_SSL_LOGIN', true);
define('FORCE_SSL_ADMIN', true);

3. In order to ensure that the various links or multimedia files previously added to the WordPress site change the http protocol To achieve https protocol, we also need to execute a replacement command through database SQL query. The code is as follows: (When using it, please modify it according to your own database table name (wp_posts) and website domain name before executing it.)

update wp_posts set post_content = replace(post_content, 'http://ws234.com','https://ws234.com');

4 , it’s done, what we need to do next is to change the external link to the new https address, and at the same time visit the https version page, including the home page, column page, inner page, sitemap, check the source code to see if there is still an http address exist.

For more wordpress related technical articles, please visit the wordpress tutorial column to learn!

The above is the detailed content of How to enable https in wordpress. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
The 5 Best IDEs for WordPress Development (And Why)The 5 Best IDEs for WordPress Development (And Why)Mar 03, 2025 am 10:53 AM

Choosing the Right Integrated Development Environment (IDE) for WordPress Development For ten years, I've explored numerous Integrated Development Environments (IDEs) for WordPress development. The sheer variety—from free to commercial, basic to fea

Create WordPress Plugins With OOP TechniquesCreate WordPress Plugins With OOP TechniquesMar 06, 2025 am 10:30 AM

This tutorial demonstrates building a WordPress plugin using object-oriented programming (OOP) principles, leveraging the Dribbble API. Let's refine the text for clarity and conciseness while preserving the original meaning and structure. Object-Ori

How to Pass PHP Data and Strings to JavaScript in WordPressHow to Pass PHP Data and Strings to JavaScript in WordPressMar 07, 2025 am 09:28 AM

Best Practices for Passing PHP Data to JavaScript: A Comparison of wp_localize_script and wp_add_inline_script Storing data within static strings in your PHP files is a recommended practice. If this data is needed in your JavaScript code, incorporat

How to Embed and Protect PDF Files With a WordPress PluginHow to Embed and Protect PDF Files With a WordPress PluginMar 09, 2025 am 11:08 AM

This guide demonstrates how to embed and protect PDF files within WordPress posts and pages using a WordPress PDF plugin. PDFs offer a user-friendly, universally accessible format for various content, from catalogs to presentations. This method ens

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!