Improving WordPress core search

WordPress’s core search capability is very simple and very primitive. That can be frustrating. We’re spoiled by Google, Bing, and the other search engines which have had decades to get really good. What makes them good is a lot of information beyond the content of any given site, and thousands of programmer labor years making … Read more

WordPress’s Query Monitor: slow and duplicate queries?

John Blackbourn’s Query Monitor plugin sometimes reports slow queries and duplicate queries. How can you interpret these reports? What are slow and duplicate queries? Slow queries Query Monitor defines slow queries as those that take more than 50 milliseconds (1/20th of a second). Query Monitor shows query times in seconds in the rightmost column of … Read more

WordPress user roles: how are they stored?

WordPress lets site administrators assign roles to their registered users. These roles are, on a standard WordPress installation, Administrator, Editor, Author, Contributor, and Subscriber. Plugins can add custom roles. For example, WooCommerce adds Customer and Shop Manager roles. The roles assigned to each user are stored in the wp_usermeta table. In an ordinary single-site install … Read more

Optimizing WordPress Database Servers

It’s common, and frustrating, for WordPress sites to be slow. When a site is slow for visitors, they give up and go elsewhere. When the dashboard is slow for site owners and content editors, it makes it harder to maintain the site, post new stuff, and handle orders (if it’s a store). Database Optimization Plugins … Read more

MariaDB has dodged the Y2038 date rollover

In a release note for MariaDB 11.5.1 (a release candidate). The TIMESTAMP range of values was extended. The maximal allowed value for timestamps was ‘2038-01-19 03:14:07 UTC’, and is now ‘2106-02-07 06:28:15 UTC’. This does not change the storage format, and new tables can be read by old MariaDB servers as long as timestamp values are within … Read more

Database Keys in Scalability Pro

Scalability Pro is a paid plugin for improving backend WordPress and WooCommerce performance. It does multiple things including query rewriting and memoization caching of some time-consuming database queries. One thing it does is add keys (indexes) to some WordPress tables. This article is a table-by-table analysis of some keys it adds, compared with the keys … Read more

Slow searching for WooCommerce orders

Background WooCommerce offers a search box on the WooCommerce -> Orders page. It lets a shop manager search orders, current and historic, for the customer’s name, address, email, and other data. It also searches the names of products and shows orders containing those products. On large sites with many orders, the search is astoundingly slow. … Read more

SQL_CALC_FOUND_ROWS in WordPress

Background When presenting so-called “archive” pages of content to users WordPress uses the notorious SQL_CALC_FOUND_ROWS MySQL extension to populate its display that looks something like this. This kind of user interface is known as “pagination” because it lets the user select pages of results. So, it’s really useful. The phrase “Showing 1-12 of 1348 results” … Read more

Slow WordPress Queries

Index WP MySQL For Speed, the WordPress plugin, allows users to monitor their MariaDB or MySQL database traffic and upload the results of those monitors. It gathers information about the queries, including how long they take and how many there are. Analyzing the uploaded monitor data allows me to identify the most frequent queries and … Read more

Filtering Database Changes During WordPress Updates

During its occasional and automatic core version updates (for example from version 5.9.2 to 5.9.3) WordPress inspects its tables in its database server (MariaDB or MySQL) and tries to restore them to WordPress’s standard schema. Sometimes a site owner or plugin customizes those tables. For example my Index WP MySQL For Speed plugin reorganizes some … Read more