Delete Expired WordPress Transients - Delete Expired WordPress Transients 🚮

Delete Expired WordPress Transients 🚮

WordPress uses transients to temporarily store data for its plugins and themes. By managing transients you can optimize your website for speed and make sure your website is always functioning properly. Here are a few methods how to safely delete expired WordPress transients: Delete Expired WordPress Transients using WPCLI To delete only expired transients use: … Read full article →

create a new wp admin users - 5 Easy ways to Create a WordPress Admin user

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 full article →

WordPress database error Table .dbwp options is marked as crashed and should be repaired - WordPress database error Table './db/wp_options' is marked as crashed and should be repaired [✔️ SOLVED]

WordPress database error Table ‘./db/wp_options’ is marked as crashed and should be repaired [✔️ SOLVED]

Here are 4 different methods to fix the scary-looking error: “WordPress database error Table ‘./db/wp_options’ is marked as crashed and should be repaired”. NOTE: It is critically important that you backup your database before performing any of the following suggestions. You’re fully responsible for undertaking this yourself, I can’t be held responsible if you break … Read full article →

How to delete all comments in WordPress - How to delete all comments in WordPress? 🗑️💬

How to delete all comments in WordPress? 🗑️💬

WordPress uses the wp_commentmeta and wp_comments tables to store comments and their data. To delete all comments in WordPress simply empty those tables in the database: To delete all spam comments use: To delete all unapproved comments use: NOTE: In the above commands change wp_ prefix with the table prefix that you are using *(view … Read full article →

Adding high performance keys to MySQL tables to speed up WordPress - Adding high-performance keys to MySQL tables to speed up WordPress 🧑🏿‍🚀

Adding high-performance keys to MySQL tables to speed up WordPress 🧑🏿‍🚀

wp_postmeta table should be the biggest table in your database, if not, there is a problem. Read wp_actionscheduler_actions & wp_actionscheduler_logs tables When you install WordPress for the first time, tables are created in the database, for example for the wp_postmeta table: the problem? solution: On an existing tables, We can add high-performance keys that match … Read full article →

Reset WordPress password from the command line - Reset WordPress password from the command line

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;

max connections - ⚠️ User already has more than 'max_user_connections' active connections [✅ SOLVED]

⚠️ User already has more than ‘max_user_connections’ active connections [✅ SOLVED]

Noticed a lot of Crawler errors on the Google Adsense console: So I enabled the WP_DEBUG and run a stress test with vegeta on the website: the website became unavailable and the following error was shown: User already has more than ‘max_user_connections’ active connections This explains the errors in Google SC because the crawler most … Read full article →

Bulk Delete Millions of WooCommerce Products using SQL - 🗑️ Bulk Delete WooCommerce Products using SQL

🗑️ Bulk Delete WooCommerce Products using SQL

While building and testing WooCommerce addons, I find myself in need of quickly deleting all WooCommerce products from the database. WPCLI is the easiest way to go, as you can achieve the desired results via a single line. NOTE:  if your database prefix isn’t the default wp_, you’ll need to change it with your actual database … Read full article →

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

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 full article →