Reinstall WordPress Core using WP-CLI
Useful WP-CLI commands that I use when cleaning hacked WordPress websites in order to reinstall WP core, all themes, and plugins from WordPress.org
💡 WP-CLI is the command-line interface for WordPress that lets you manage your WordPress site, themes, and plugins from the terminal.
Here you can find most useful WP-CLI commands and tutorials.
Useful WP-CLI commands that I use when cleaning hacked WordPress websites in order to reinstall WP core, all themes, and plugins from WordPress.org
For high-traffic websites, I advise developing a stagging website if you make significant updates or even switch the WordPress theme entirely. But one significant problem I encountered while moving from the staging site to the live one is that all database tables are updated, which could result in financial loss if the website receives multiple … Read full article →
Here are five different methods to create a new WordPress Admin user. In all of the examples below I will use the following username/password combination, so make sure to change it before running any of the commands: username123 change username123 with your username password123 change password123 with your password [email protected] change [email protected] with your email … Read full article →
In this post, I will be using 3 free tools to scan WordPress websites for vulnerabilities. NAME PLATFORM HOW TO USE LIMITS WPScan Windows & Linux terminal free plan: 25 reports daily WPSEC website online free plan: 20 scans daily Burp Suite Windows & Linux application ∞ 1. From the terminal: WPScan If you have … Read full article →
Recently I was migrating a website from GoDaddy shared hosting using WP-CLI and noticed the PHP version in cli was outdated. Here is how to install WP-CLI and set custom PHP version for the cli. Setup WP-CLI To download WP cli: To run it use php wp-cli.phar To make it easier to call We’ll rename … Read full article →
If you used shortcodes from a certain plugin or a theme and then stop using either one, then chances are that you still have shortcodes that no longer translate into anything. In this guide We will be using WP CLI Shortcode scrapper package to find all shortcodes in the database. This command works by searching … Read full article →
We recently made a list of the most useful WP-CLI commands with examples and how to fix the most common WPCLI errors but there are a lot of maintenance tasks that can be done with WP-CLI that We haven’t included in this list. One of those tasks is reinstalling WordPress Core using WP-CLI. Step 1. … Read full article →
Here are a few WP-CLI tricks and tips that might be useful: Aliases Use aliases to make commands shorter and easier to remember. You can use the –alias=<alias> flag when defining a command to specify a shorter alias for the command. For example, if you use a command wp my-command: you could define a command … Read full article →
This simple query allows you to transfer all posts from one user to another. SQL query This will assign all posts from author ID=14 to the user with ID=1 (admin). WP-CLI This will remove the user [email protected] and assign all his posts to user with ID=1 (admin).
When cleaning websites that have large databases, regular text editors can’t even open the database dumps (Notepad++ supports files up to 2GB in size). So to run a search and replace on large database dumps I suggest using regex-replace line-by-line in PHP, or setting up WPCLI and running regex search & replace. Here is a … Read full article →