Category: WordPress

  • Half Baked Idea: Limiting WordPress Image Upload Sizes

    Half Baked Idea: Limiting WordPress Image Upload Sizes

    Limit image upload size in WordPress media library by using the `wp_handle_upload_prefilter` filter. Implement a custom function to check and restrict the size of uploaded images. Utilize PHP code to set a maximum size limit and display an error message if the file exceeds it. Add this functionality to your WordPress site.

  • Quick Tip: Get Size of Revisions in WordPress

    Quick Tip: Get Size of Revisions in WordPress

    Monitoring and managing data bloat in a WordPress site can be crucial. The introduction of the block editor has led to a surge in post revisions, which can clog up the database. Conducting a revision data audit using SQL queries can reveal the extent of unnecessary data accumulation, highlighting the importance of setting limits to…

  • Cool WordPress Plugins: Embed Extended

    Cool WordPress Plugins: Embed Extended

    A plugin called Embed Extended transforms OpenGraph data into oEmbed data for WordPress, allowing for easy and visually appealing embeds in the block editor. It enhances the overall embedding experience on WordPress sites, making it simpler and more enjoyable for users.

  • Quick Tip: Script Debugging in WordPress

    Quick Tip: Script Debugging in WordPress

    When debugging core WordPress scripts, dealing with cached copies like in `script-loader.php` can be tricky. You can apply a unique `ver` argument to core scripts on each refresh using a filter. This ensures you get the most recent version from page and browser cache. Remember to enable `SCRIPT_DEBUG` when debugging core scripts.

  • Quick Tip: Disable WordPress Block Editor Fullscreen Mode

    Quick Tip: Disable WordPress Block Editor Fullscreen Mode

    Editing posts in WordPress can be frustrating when the block editor keeps defaulting to fullscreen mode. Utilize this PHP code snippet to disable the fullscreen mode by default for a smoother editing experience. Credits to Jean-Baptiste Audras for sharing this helpful solution.

  • Getting WordPress Database Size via WP-CLI

    Getting WordPress Database Size via WP-CLI

    A WordPress WP-CLI command `db-size` allows fetching database tables, their data, and index size in various formats. The command offers sorting options like total, table, data size, and index size. Use `–format` to adjust the output format (`table`, `csv`, `json`, `count`, `yaml`), and `–raw` for full byte size.

  • Quick Tip: Export WordPress SQL output via WP-CLI

    Quick Tip: Export WordPress SQL output via WP-CLI

    Learn how to run custom SQL queries on your WordPress database using a small WP-CLI command. The command supports different output formats like table, CSV, JSON, and more. Plus, it includes a dry run option for safety. No need to rely on `wp db query` anymore!

  • Half-Baked Plugins: Embeds for Twitch and Gutenberg

    Half-Baked Plugins: Embeds for Twitch and Gutenberg

    Learn about Embeds for Twitch and Gutenberg, a WordPress plugin for embedding Twitch channels, videos, and clips as Gutenberg blocks. No plans for release, just for learning. Note: Clip functionality may be faulty. Explore Half-Baked Plugins for more experimental projects.

  • Deleting Old Post Revisions in WordPress with WP-CLI

    Deleting Old Post Revisions in WordPress with WP-CLI

    Working with a client’s large database, I crafted a custom WP-CLI command to purge post revisions based on specific criteria, saving backups of those deleted. This script efficiently prunes revisions older than a year and prior to post publication, reducing the overall database size prior to a site migration.