This code will select a random user agent from a predefined list of valid user agent strings. It’s useful for building certain types of web crawlers or cache warming bots. It helps bypass firewalls that reject requests missing a user agent string.
Custom excerpts are better for UI/UX because in their absence, most WordPress themes will just grab text from your content. But writing custom excerpts of proper length can be tricky. What you need is a character counter on your WordPress excerpt box!
If you use the a3 Lazy Load plugin on a WooCommerce shop, you may notice that while images on single product pages are nicely lazy loaded, the lazy-loading feature just doesn’t work on archive pages. This article contains code to fix the problem.
Quick PHP code snippet to extract an Amazon product ASIN code or ISBN number from any Amazon US product URL. Works via a regular expression and the “preg_match” function.
When an image is uploaded to WordPress, its title is auto-populated based on filename. But WordPress does NOT set the image Alt Text or other fields. For image-heavy sites, this implies repetitive manual effort. Read to learn how to automate this.
The title “Shop” shown on the WooCommerce shop page is just plain ugly in my opinion. Especially if you use the WooCommerce shop page as your site’s homepage. Here’s how to change/remove it from the homepage without affecting other archive pages.