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 →

Suggestions to reduce the wp options table size - Suggestions to reduce the wp_options table size

Suggestions to reduce the wp_options table size

In this post I discussed an example where wp_options table had 900k rows of plugin-based data in it, causing the wp-admin dashboard to load slowly. As noted there, good coding practice is for each plugin to create its own database tables and use those instead of default WP tables. While the WordPress community actively improves … Read full article →

Optimize WordPress Database Tables - Optimize WordPress Database Tables

Optimize WordPress Database Tables

There are several ways you can optimize the MySQL database used by your WordPress site: Optimize tables Optimize all tables in your database: OPTIMIZE TABLE wp_posts, wp_comments, wp_options, wp_usermeta, wp_term_relationships, wp_term_taxonomy, wp_termmeta; Replace wp_ with the database prefix that you are using for your WordPress installation. Repair tables Repair any damaged tables in your database: … Read full article →

wpcli export specific tables wordpress - Dumping specific tables using mysqldump or WP-CLI

Dumping specific tables using mysqldump or WP-CLI

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 →