Using WP-CLI to Batch Autodelete Inactive WordPress Plugins

Keeping a clean and secure WordPress site is best practice. This means the database doesn’t have unnecessary bloat and all plugins are useful and up-to-date. A clean WordPress site is essential for making troubleshooting easy in case things ever go pear-shaped. Inactive plugins that are outdated and have security vulnerabilities are still dangerous for your … Learn more…

Using WP-CLI for Batch Updating Contact Form 7 Postmeta Options

I recently set up Mailgun for a Codeable client who was using Contact Form 7. Unfortunately after integrating Mailgun to improve the reliability of email delivery, the formatting of the emails was not quite right. I managed to isolate the issue to a setting called Use HTML Content Type in Contact Form 7 which had … Learn more…

Check WordPress wp-cron Count with WP-CLI + Monit + Email Alerts

Monit is a very flexible Monitoring tool to help ensure your services are always running. It can be used to send email alerts (guide with Mailgun) when processes crash and automatically restart them. On all the VPS and dedicated servers I set up for my clients on Codeable, I configure Monit for proactive monitoring. wp-cron … Learn more…

Automatically Delete Expired WordPress Transients using WP-CLI

WordPress plugins and themes can store a lot of temporary data known as transients. By default these transients are stored in the wp_options table and can accumulate rather quickly. Recently on codeable I cleaned a site with 58000 expired transients that were causing the database to crash daily. Due to an idiosyncrasy in WordPress core, … Learn more…

Batch Lossy Compress PNG with pngquant Linux Command Line

Image optimization is critical for high performing websites. The smaller your images are the less space they take up which is great for desktop and mobile users. Lossy compression yields smaller file sizes than lossless compression. Lossy Compression of PNGs can be done with pngquant hosted on github. This guide will show you how to batch … Learn more…