Newsletter

WP Snippets: practical WordPress development tips

Short, practical notes on WordPress development. Read the latest posts here, and subscribe on LinkedIn to get the next one.

  1. #40 Accessibility

    Fix featured image links that screen readers can’t name

    Fix WordPress featured image links with no accessible name: find images missing alt text with WP-CLI and update your archive template the right way.

  2. #39 Performance

    Stop post revisions from piling up

    Limit WordPress post revisions with WP_POST_REVISIONS and the wp_revisions_to_keep filter, then safely clean up old revisions with WP-CLI.

  3. #38 AI in WordPress

    Give a WordPress ability input and validate it

    Add input to a WordPress Abilities API ability: validate it with a JSON Schema, check per-post permissions, and test the whole thing with WP-CLI.

  4. #37 Dev Workflow

    Set up WP_DEBUG the safe way

    Set up WP_DEBUG the safe way: log WordPress errors without showing them, move debug.log out of public reach, and toggle debugging with WP-CLI.

  5. #36 Performance

    Cache a slow WP_Query with a transient

    A sidebar “featured posts” list can run a slow meta query on every page load. Here’s how to cache it with a transient, clear it automatically when posts change, and check it with WP-CLI.

  6. #35 AI in WordPress

    Register your first WordPress ability

    Learn how to register a read-only ability with the WordPress Abilities API, count draft posts, add permission checks, and run it through WP-CLI or REST.

  7. #34 WordPress

    Stop your staging site from emailing real customers

    Prevent your WordPress staging site from emailing real customers. Learn how to stop accidental emails while testing site changes in a staging environment.

  8. #33 Accessibility

    Add a skip link to a classic theme

    Improve WordPress accessibility by adding a skip link to your classic theme, helping keyboard users bypass navigation and jump directly to the main content.

  9. #32 WordPress

    Defer scripts with wp_enqueue_script()

    Learn how to defer JavaScript in WordPress using wp_enqueue_script() to reduce render-blocking scripts and improve page loading performance.

WP Snippets shares small fixes from my client work. If you need help with a WordPress project, see my services or get in touch.