Code Snippets.
A growing library of copy-paste solutions for WordPress, performance, security, and infrastructure.
Edge Cache Headers for WordPress on Cloudflare
Set aggressive cache-control headers for static assets and fine-tune TTLs for HTML to get the most out of Cloudflare's edge network.
Disable XML-RPC in WordPress
Block XML-RPC requests at the server level to reduce your attack surface without relying on a plugin.
BuddyBoss: Bulk Message All Members of a Specific Group
This script sends a direct message to every member of a specified group. This is incredibly useful for important announcements, updates, or engaging with specific segments of your community.
BuddyBoss: Delete Inactive Members Who Haven’t Logged in
Keep your community vibrant and your user list clean by periodically removing members who haven’t engaged in a long time. This script removes users who have not logged in within a specified number of days.
BuddyBoss: Find and Replace Text in All Forum Posts
When you need to update a term, link, or any piece of text across all forum discussions, this script is a lifesaver. It leverages the powerful wp search-replace command but scopes it specifically to the forum post type.
BuddyBoss: Generate a Group Activity Report
Quickly get a snapshot of which groups are the most active. This script lists all groups and shows the total number of members and the number of new activity posts in the last 30 days.
BuddyBoss: Sync Member Profile Field from WordPress User Meta
This script is perfect for situations where you have user data in the standard wp_usermeta table (perhaps from a registration form or another plugin) and you want to display it in a BuddyBoss profile field.
Add CSV to Rest Endpoints
A PHP snippet for Add CSV to Rest Endpoints.
Add Custom Authorization Header to REST API Requests
A PHP snippet for Add Custom Authorization Header to REST API Requests.
Audit Database Table Size
A PHP snippet for Audit Database Table Size.
Audit Site Performance: Query Execution Time
A PHP snippet for Audit Site Performance: Query Execution Time.
Auto-Link Keywords in Post Content Using make_clickable
A PHP snippet for Auto-Link Keywords in Post Content Using make_clickable.
Auto-Revoke Expired Application Passwords
A PHP snippet for Auto-Revoke Expired Application Passwords.
Automated Inactive User Notification
A PHP snippet for Automated Inactive User Notification.
Birthday Email Greetings Based on User Meta Data
A PHP snippet for Birthday Email Greetings Based on User Meta Data.