A bash script that tries to automate the moving from HTTP to HTTPS, by doing most of the heavy lifting using WP-CLI.
It creates a backup of your current database first.
It then replaces all instances of http
with https
on the current WordPress install, and updates .htaccess
to force to HTTPS.
It cannot update all theme/plugin files to be requested using HTTPS. If a plugin is using HTTP for the load, you will get mixed content warnings in your browser. If you're looking for a solution to these cases i suggest you check out Really Simple SSL
Install with:
curl -sSL https://wp2ssl-installer.includes.io | bash
If you want to update the script you can use two options. Either run the same command as the install (will auto-update if needed), or use the built-in updater
wp2ssl --up
or
wp2ssl --self-update
For now, the plugin will only function if called from the main WordPress folder.
Use with:
cd /home/someuser/public_html
wp2ssl
____ _
__ ___ __|___ \ ___ ___| |
\ \ /\ / / '_ \ __) / __/ __| |
\ V V /| |_) / __/\__ \__ \ |
\_/\_/ | .__/_____|___/___/_|
|_|
v. 1.1
https://github.com/niladam/wp2ssl
[FLAGS]
--up, --self-update Self update this script to the latest version.
Uses curl if available and fallsback to wget,
if curl is missing.
--h, --help This help screen.
The script has been tested on a fresh WordPress install and it worked out of the box. So i guess YES !:)
Found a bug ? Please use the isues section and report it. I'll be glad to tackle them.
If you want to contribute to this script, please fork/clone create a new branch and use the pull requests. I'll be glad to see them coming.
- Bulk run ?
- Identify scripts/javascripts and force them to use HTTPS ?
- Suggest and/or install Really Simple SSL after use?
- Suggest and/or run backup before attempting the database changes ? Since #a854614 the plugin runs an export and archives the database dump. Just to be safe :)
- Force WP-ADMIN SSL after run ?
Some of the functionality in this script were originally built for WPEB - WordPress Easy Backup, another script that might be of your interest.
WP2SSL (WordPress 2 SSL) is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (optionally) any later version.