After Import: Insert “Use” Statement in Database

It appears, at least in cPanel, the lines in question were not required in the export, with the unsurprising consequence of the other encapsulated sql statements defaulting to reference the current database only. Turns out to be convenient when more than one database is configured, so long as there are no statements that select objects … Read more

Do Seeded Orderby Rand Queries Benefit from DB Caching?

Looking at the source of class-wp-query.php (ie, the WP_Query code), I find this: /* * Ensure the ID database query is able to be cached. * * Random queries are expected to have unpredictable results and * cannot be cached. Note the space before `RAND` in the string * search, that to ensure against a … Read more

How to reduce uncached page generation time?

there is no simple general answer for this, as it depends on what is causing the issue. Best way is to check your page using some Insights tool: https://pagespeed.web.dev/ https://gtmetrix.com/ They will tell you where the issue is. Big images are commonly a big issue – there are many converters to WebP format, that will … Read more

Batch Replace URLs in WordPress Database

No because you’re running the command on the posts table, and only on the content column, but ACF fields aka post meta are stored in the post meta table, not the content column of the posts table so no search replacing is occurring. You can tell WP CLI to perform the search replace with PHP … Read more

How to find source of these strange SQL queries?

They’re from WordPress. They come from the wp_old_slug_redirect() function which is run whenever there is a 404. The purpose is to check if the requested URL was the old URL for a post so that it can redirect to the new URL. If you’re seeing a lot of these then it means you’re getting a … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)