Best way to search and replace within serialized database strings?

It seems WP-CLI is indeed one of the easiest ways to search/replace serialized strings, e.g. for replacing any unwanted instances of staging links: wp search-replace https://staging.example.com https://example.com –all-tables The above command will search the entire WordPress database for the first string, and replace all instances with the second string provided. If you want to test … Read more

WordPress Customise

The interstitial page on that website isn’t part of WordPress. It’s just an external page with some ads and a download link on it. You can easily do this by yourself. Create a php file named download.php on your server and add the following code to it: <html> <head> <meta http-equiv=”refresh” content=”5; url=<?php $_GET[‘url’];?>” /></head> … Read more

echo vs output variable [closed]

I believe this topic was addressed quite thoroughly here. I might add that within the WordPress community it is common syntax practice to default to echoing tags with an option or alternative/interior function to return the result instead. This I believe is driven by the level of code experience the average user within WordPress has … Read more

Lots of SQL queries

Delete post/page revisions and that will reduce queries as well as the overall size of the DB. Run this in phpmyadmin (backup the DB first): DELETE a,b,c FROM wp_posts a LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) LEFT JOIN wp_postmeta c ON (a.ID = c.post_id) WHERE a.post_type=”revision” Change table prefix above if needed. And … Read more

Using queries in and i see 7000+queries?

195 queries for one page is a lot. 7000 queries is not a lot, it is insane. Install Query Monitor. It tracks all queries and presents them in groups. I don’t know if it can track that many queries, this is probably an interesting stress test. 🙂 Find the source of those queries, deactivate it. … Read more