Tag: post-management

  • How To Restrict User to Self Posts in WordPress

    How To Restrict User to Self Posts in WordPress

    To secure our private site while using a third-party WordPress REST API integration, I restricted the plugin user to its own posts with user_has_cap and allowed access to its revisions. I also used posts_results to mark non-qualifying posts as private. Here’s a sample implementation for similar needs.

  • iOS Reminders to Habitica To Do’s via IFTTT

    iOS Reminders to Habitica To Do’s via IFTTT

    Learn how to sync iOS Reminders with Habitica’s To Do’s using IFTTT. Utilize Habitica’s API to create tasks and authenticate requests with special headers and a JSON body payload. IFTTT will send the data to Habitica, allowing you to earn XP as you complete tasks.

  • 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…

  • 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.

  • WordPress Post Meta and JSON

    WordPress Post Meta and JSON

    Learn about the challenges of storing JSON strings in WordPress post meta. Discover how WordPress’s `wp_unslash()` function can unintentionally interfere with the data. Find out how to safely store JSON by using `wp_slash()` to double-encode it, ensuring data integrity when unslashing.

  • Logging Post Status Transitions in WordPress

    Logging Post Status Transitions in WordPress

    There’s a simple solution I found to log all post status transitions in post meta.