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 CS6

Dreamweaver CS6

Visual web development tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment