Snippet library
WordPress code snippets, ready to use.
707 free & Pro snippets and modules. Copy-paste-ready, or import in one click with SnipCraft.
Display Last Updated Date
Appends the post's last-modified date below the content on single posts.
Disable Comments Site-Wide
Completely disables WordPress comments: closes them on all post types, removes the Comments menu, hides the admin bar node, and suppresses existing comments.
Add Custom Post Type Count to At a Glance Widget
Appends a published-count entry for a custom post type (default: 'product') to the Dashboard At a Glance widget.
Restrict Media Library to Own Uploads
Limits non-administrator users to viewing and managing only their own uploaded media files in the Media Library.
Redirect to Live Post After Publishing
After a post is newly published the editor is redirected to the live post URL instead of remaining on the edit screen.
Add Settings Link to a Plugin on the Plugins Page
Prepends a Settings action link for a specific plugin on the Plugins admin list — update the plugin basename and settings URL as needed.
Duplicate Post Row Action
Adds a nonce-protected Duplicate row action to the Posts list that creates a draft copy including all post meta and taxonomy terms.
Custom Dashboard Welcome Widget
Registers a branded quick-start widget on the admin dashboard showing live post, page, and comment counts with action buttons.
Role-Based Login Redirect
Sends users to different URLs after login depending on their WordPress role, e.g. subscribers to /account/ and editors to the post list.
Track and Display Last Login in Users List
Records each user's last login timestamp and displays it as a sortable column in the Users admin list table.
Custom Login Logo, URL, and Title
Replaces the WordPress logo on the login page with the site's custom logo, linking back to the homepage.
Redirect Subscribers Away from wp-admin
Redirects logged-in users who lack editing capabilities to the homepage when they try to access wp-admin.
Remove Default Dashboard Widgets
Removes the Quick Draft, WordPress Events & News, and Activity widgets from the admin dashboard.
Custom WordPress Email From Name and Address
Changes the default WordPress email sender name and address to your site name and a noreply alias.
Disable Author Archive Pages
301-redirects all author archive URLs to the homepage, effectively disabling them to reduce user enumeration exposure.
Set Default Admin List Screen Per-Page Count
Sets the default number of rows shown on admin list tables to 25 for users who have not yet changed the preference.
Add Featured Image Column to Posts List
Inserts a thumbnail preview column before the Title column in the wp-admin Posts list table.
Add Custom Body Class on Login Page
Appends a custom CSS class to the body tag on wp-login.php for targeted login-page styling.
Replace "Howdy" Greeting in Admin Bar
Swaps the "Howdy, Username" text in the admin bar with a plain "Hello, Username" for a more neutral tone.
Hide Update Nag for Non-Admins
Removes the WordPress core update notification banner for users without the manage_options capability.
Remove WordPress Logo from Admin Bar
Removes the WordPress logo menu node from the admin toolbar for all users.
Generic Login Error Message
Replaces specific login error messages with a generic one to prevent username and email enumeration.
Hide Admin Bar for Non-Admins on Front End
Removes the front-end admin toolbar for logged-in users who do not have the manage_options capability.
Custom Admin Footer Text
Replaces the default 'Thank you for creating with WordPress' footer credit in wp-admin with your site name.