Delete Unused Post Revisions

Post revisions are a WordPress feature that allows you to undo changes and go back to an earlier version of your posts and pages, it works by auto-saving every 60s while you edit content. Since revisions can take up a lot of space in the database, it is a good idea to delete them. or You … Read more

5 Easy ways to Create a WordPress Admin user

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 more

Change image URL in WordPress database

Many users choose to host their images on an external service to reduce the load on their hosting. If you are interested in doing this, you will only have to change the location of all the images that you have already uploaded. To do this, you need to make two SQL queries in your database: 1. … Read more

Reset WordPress password from the command line

1. log in to the MySQL: mysql -u root -p; 2. Select the database: use database_name; 3. List all users: select * from wp_users\G 4. Change the password for the user you require: UPDATE wp_users SET user_pass=MD5(‘new_password_here’) where ID=user_id_here;

wp_actionscheduler_actions & wp_actionscheduler_logs tables

WooCommerce plugin uses the wp_actionsscheduler_actions table in the database to log scheduled actions such as cron’s running, product synchronization, upgrade, etc. These actions should be deleted once they are executed but this doesn’t always happen, in most cases, this table uses an InnoDB database engine with a row-level locking feature meaning that multiple queries can … Read more

Save database queries for analysis in WordPress

The SAVEQUERIES wp-config constant saves database queries to an array and We can use that array to display queries. The information saves each query, what function called it, and how long that query took to execute. To enable SAVEQUERIES add this to the wp-config.php file: Then in the footer of your theme put this: <?php … Read more

How to access WordPress using temporary server URL

We occasionally find ourselves in a situation where we need to test the website first, then point the domain name if everything is in order. To achieve this there are multiple ways: Edit Hosts file on your local computer Use online service such as skipDNS Access WordPress using temporary server URL In this guide We … Read more

Use mysql2date to convert date string obtained from the database into a readable date

Instruction: Parameter PARAMETER TYPE DESCRIPTION DEFAULT REQUIRED $format string Output can be PHP date format or Unix timestamp. no yes $date string mysql2date() only recognizes “Ymd H:i:s” format, so the original timestamp string needs to be converted to this format. no yes $translate boolean If true, the specified date and format string will be passed … Read more

How to change domain name for a WordPress website (5 ways)

Want to change the domain name for your WordPress website? No problem, in this guide We’ll walk you through 5 different methods to change the domain name for a WordPress website from cPanel PHPMyAdmin. Before following this guide make sure you’ve down the following: registered the desired domain name and pointed it towards your hosting … Read more