Hello, today we are going to learn how we can migrate our WordPress site from HTTP to a secure HTTPS version under the TLS/SSL protocol.
![](https://i0.wp.com/images.pexels.com/photos/1680214/pexels-photo-1680214.jpeg?w=1200&ssl=1)
The first thing we are going to do is to install this plugin that will allow us to replace internal links from HTTP to HTTPS:
Search for search & replace (https://es.wordpress.org/plugins/search-and-replace/)
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2024/01/imagen-40.png?resize=852%2C336&ssl=1)
And install it.
Another one I recommend installing is this: (https://es.wordpress.org/plugins/better-search-replace/)
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2024/01/imagen-50.png?resize=797%2C306&ssl=1)
Now let’s go to Tools > Search & Replace
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2024/01/imagen-43.png?resize=414%2C340&ssl=1)
I recommend making a backup of the database:
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2024/01/imagen-44.png?resize=442%2C229&ssl=1)
Now let’s Replace Domain URL:
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2024/01/imagen-45.png?resize=295%2C82&ssl=1)
And we have to indicate the URLs, we indicate the current URL and the new one:
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2024/01/imagen-46.png?resize=871%2C171&ssl=1)
We click on replace domain/URL
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2024/01/imagen-47.png?resize=264%2C85&ssl=1)
Once finished it appears:
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2024/01/imagen-48.png?resize=501%2C209&ssl=1)
We click on download SQL file, as it contains the Database with the changes made.
And now we import it, we go to Import SQL, select our new file and click on Import SQL file:
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2024/01/imagen-49.png?resize=937%2C357&ssl=1)
Now we need to go to our WordPress administration and change the URL addresses:
Go to Settings > General
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2024/01/imagen-37.png?resize=456%2C468&ssl=1)
Now go to WordPress Address (URL) and Site Address (URL)
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2024/01/imagen-38.png?resize=778%2C146&ssl=1)
And change it to HTTPS:
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2024/01/imagen-39.png?resize=792%2C125&ssl=1)
Now we need to add the following to the .htaccess file:
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] </IfModule>
And now it’s important that in our environment SSL is activated, for that I have some tutorials around here: https://devcodelight.com/crear-un-docker-compose-con-php-nginx-mysql-mariadb-nginx-proxy-manager-para-certificados-ssl-https/ or https://devcodelight.com/certificados-ssl-lets-encrypt-en-docker-usando-nginx-proxy-manager/
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2023/07/cropped-light_logo-5.png?resize=100%2C100&ssl=1)