When the WordPress comment option is abused by spammers, it becomes a real pain in the “@ss”. With thousands spam reactions, disabling -and removing- WordPress comments is the only way to go. Here is how to disable WordPress comments in both the WordPress Dashboard interface and in your MySQL database. As a bonus, I show you how to re-enable comments too!
Tag: MySQL
How to string replace on all WordPress posts in MySQL
Replace all instances of a string in WordPress using phpMyAdmin and SQL statements, or a WordPress plugin. Learn how to replace content in your MySQL database in bulk with MySQL REPLACE.

MySQL sleep() attacks
MySQL sleep() command injection attacks: how not validating your PHP user input can lead to Denial of Service (DoS) attacks against websites and back-end database servers. Simply by putting “AND sleep(3)” in the address bar… Here is how to put a MySQL server to sleep, happy SQL injection!

MySQL database optimization with indices
MySQL indexes (indices) are important. Why? Because they speed up the process for MySQL to find requested information.

Convert MySQL MyISAM tables to InnoDB
Convert MyISAM to InnoDB for better database performance. In the earlier days of MySQL, the default storage engine for your database tables was “MyISAM”. InnoDB is the engine to use now, and MyISAM is no longer actively developed. Therefore all MySQL optimizations are for InnoDB, and it’s recommended to switch from MyISAM to this InnoDB storage engine for your MySQL database tables. Follow this tutorial on how to convert from MyISAM to InnoDB.

How to flush MySQL query cache from time to time
Flush MySQL query_cache to prevent fragmentation of free query cache memory space. Flushing the query cache with flush query cache does not delete or clear the query cache. You have to use reset query cache to fully clear MySQL’s query cache.
How to: Test MySQL database connectivity in ASP.NET, PHP, ASP
Test MySQL database connectivity in ASP.NET, PHP, ASP; Simple MySQL connection test from your website with ASP.NET, PHP & classic ASP. Whenever you need a MySQL connectivity test from a website or server, it’s handy to have various test scripts nearby. Whether it is because you are setting up a new website or you have just installed a new server and are running your tests.
WordPress wp_options table autoload micro-optimization
The autoload feature loads and caches all autoloaded options, if available, or all options. The default option is to autoload, and over time when the wp_options table grows, this degrades performance. Today I noticed a slow MySQL query coming from a WordPress database (WordPress wp_options table). This made me investigate and to optimize the WordPress wp_options table “autoload” feature.

Check, repair and optimize MySQL tables with mysqlcheck
Check, repair and optimize MySQL tables with mysqlcheck. The mysqlcheck client is a command line table maintenance program for MySQL. Mysqlcheck checks, repairs, optimizes, or analyzes MySQL tables. In this post I’ll show you how to use mysqlcheck to optimize all MySQL tables using a cronjob.
Optimize WP StatPress plugin database performance
The WordPress plugin StatPress (no longer available in the Plugin Directory) is still widely used and still is very slow. Here are some MySQL statements you can use to optimize its performance, as a WordPress optimization tip…
How to compare MD5 and SHA1 hashes in MySQL
Some web scripting languages, such as classic ASP, don’t have native string hashing functions – like MD5 or SHA1. This makes it quite difficult to hash or encrypt user supplied input, and to perform string comparison to compare hashes. Let’s make MySQL do the string comparison and hash calculations for us!
Optimize all MySQL tables with PHP/MySQLi multi_query
PHP script to make your MySQL database smaller, leaner and faster! The PHP MySQLi extension supports multiple queries, which are concatenated by a semicolon, with mysqli->multi_query. We use this to optimize all MySQL tables, in a single multi-query statement. Neat! Optimizing MySQL tables is important to keep tables small and fast. This boosts MySQL, PHP and website performance and we all love that, don’t we?

Clean-up WordPress spam comments and meta data
How to delete WordPress spam comments and meta data with phpMyAdmin. A lot of WordPress spam comments and meta data will keep your WordPress database huge, and slows down your site. It’s best to delete spam comments regularly, but if you’re facing hundreds of thousands spam comments, here is how to delete them all in bulk.

Block WordPress comment spammers manually
Learn to block WordPress comment spammers manually. The less spammers hit your WordPress blog, the better your blog performs, is one of my opinions. A second is, the less unnecessary plugins you use on your WordPress blog, the better. So, a little while ago I decided to remove plugins like Stop Spammer Registration Plugin and do its work myself. Here is why & how.
WordPress CMS admin password reset
How to reset your WordPress password? If you’ve lost or forgotten your WordPress admin password, you can easily reset the password. Either use the following MySQL statement to reset your WordPress admin password, or change it through functions.php