Snippet library
WordPress code snippets, ready to use.
707 free & Pro snippets and modules. Copy-paste-ready, or import in one click with SnipCraft.
Disable Specific REST API Routes
Removes the /wp/v2/users and single-user REST endpoints to prevent unauthenticated enumeration of user logins and IDs.
Add CORS Headers to REST API Responses
Adds Access-Control-Allow-Origin and related CORS headers to REST API responses so headless front ends on separate origins can make authenticated requests.
Register a Custom Read-Only REST Endpoint
Creates a public GET /wp-json/scseed/v1/site-info endpoint that returns the site name, URL, description, language, and timezone as JSON.
Add Custom Post Meta Field to REST Response
Registers a custom _scseed_subtitle meta key on post objects in the REST API, exposing it for both reading and writing by authorised editors.
Add Featured Image URL to Posts REST Response
Registers a featured_image_url field on the post REST object so headless themes can access the full-size image URL without an extra request.
Restrict Plugin Activation to Super Admins on Multisite
Removes the activate_plugins capability from regular site admins on a multisite network so only super admins can activate or deactivate plugins.
Auto-Activate Plugins on New Multisite Sites
Automatically activates a predefined list of plugins on every newly created subsite in the network to enforce a consistent baseline setup.
Add Custom Column to Network Sites List
Inserts a "Last Post" column into the Network Admin Sites table showing the most recent published post date for each subsite.
Set Default Theme for New Multisite Sites
Automatically activates a specified theme on every newly provisioned subsite in a WordPress multisite network.
Allow Only Logged-In Users (Private Site Gate)
Redirects unauthenticated visitors to the login page for every front-end request, turning the site into a members-only experience.
Custom Welcome Email to New Users
Sends a branded HTML welcome email to every new registrant with their login link, overriding the default WordPress notification.
Auto-Login After Registration
Automatically authenticates a new user and redirects them to the site after they complete registration, removing the need to log in manually.
Remove Login Page Shake Animation
Disables the CSS shake animation applied to the login form when an incorrect password is entered, for a calmer error experience.
Add Logout Link to Navigation Menu
Appends a logout link (or a login link for guests) to the primary navigation menu, automatically using the correct URL and label based on auth state.
Disable Gravatar and Use Local Fallback Avatar
Prevents WordPress from requesting Gravatar images from external servers, returning a local placeholder for all users to improve privacy and load speed.
Set Custom Default Avatar
Registers a local image as a new default avatar option and forces it as the site default, replacing the generic mystery-person silhouette.
Add Custom Links Below Login Form
Appends a Privacy Policy and Terms of Service link beneath the WordPress login form using the login_footer action.
Disable Login Page Language Switcher
Removes the language/locale dropdown displayed beneath the WordPress login form, keeping the page minimal for single-language sites.
Extend Login Session Duration
Increases the WordPress authentication cookie lifetime to 30 days for a normal session and one year when "Remember Me" is checked.
Check Remember Me by Default on Login
Pre-checks the "Remember Me" checkbox on the WordPress login form using a small script injected into the login footer.
Disable New User Notification Emails
Suppresses both the admin notification and the default welcome email sent to the registrant whenever a new account is created.
Set Default Role for New Registrations
Overrides the default role assigned to newly registered users, setting it to "subscriber" regardless of the value saved in Settings → General.
Redirect Logged-In Users Away From Login Page
Sends already-authenticated visitors to the dashboard (admins) or homepage (others) when they attempt to load the login screen.
Redirect Users After Logout
Redirects users to the site homepage instead of the login screen after they click Log Out.