Snippet library
WordPress code snippets, ready to use.
707 free & Pro snippets and modules. Copy-paste-ready, or import in one click with SnipCraft.
Remove Admin Color Scheme Picker
Hides the color scheme picker from user profile pages to enforce a consistent admin theme.
Disable Site Health Widget and Page
Removes the Site Health dashboard widget and hides the Site Health submenu link from wp-admin.
Sort Plugins List Active First
Reorders the Plugins admin list so active plugins appear at the top, making status scanning faster.
Hide Admin Menu Items by Role
Removes specified top-level admin menu pages for non-administrator users to declutter their dashboard.
Reorder Admin Menu Items
Sets a custom top-level order for the WordPress admin navigation menu using the menu_order filter.
Add User Role Column to Users List
Appends a Role column to the Users list table for quick role visibility without opening each profile.
Add Registration Date Column to Users
Adds a sortable Registered date column to the Users list table formatted with the site date setting.
Add Image Dimensions Column to Media
Shows width × height in pixels for image attachments in a dedicated Media Library list column.
Add File Size Column to Media Library
Displays the file size of each attachment in a new column on the Media Library list view.
Add Last Modified Column to Posts
Appends a sortable Last Modified date column to the Posts list table in wp-admin.
Add Post and Page ID Column
Adds a numeric ID column to the Posts and Pages list tables so editors can quickly copy IDs.
Newsletter Signup Form Markup
A styled newsletter opt-in section with first name and email fields, AJAX submission via wp_ajax, and inline feedback.
Schema.org Breadcrumb Markup
Accessible breadcrumb navigation with BreadcrumbList microdata for structured data and correct ARIA labelling.
FAQ Page Schema JSON-LD
Embeds structured FAQ data as JSON-LD schema markup to enable rich results in Google Search.
Social Share Button Row
A share strip with Twitter/X, Facebook, LinkedIn, and a copy-link button; URLs are populated from the current page via JS.
Call-to-Action Banner
A full-width promotional CTA section with a heading, supporting text, and two action buttons (primary and secondary).
Cookie Notice Banner Markup
A fully functional GDPR-style cookie notice banner with Accept/Decline buttons, persisted via localStorage.
Current Year Auto-Update
Replaces the text content of elements with class current-year or a data-current-year attribute with the live year.
Reading Progress Bar
Injects a fixed top progress bar that fills as the user scrolls through the page, using requestAnimationFrame for performance.
Shrink Header on Scroll
Adds an is-shrunk class to the site header after scrolling past a threshold, reducing its padding with a CSS transition.
Auto-Resize Textareas
Dynamically expands any textarea to fit its content as the user types, eliminating the need to scroll inside the field.
Lazy-Load Iframes via IntersectionObserver
Defers iframe loading until the element enters the viewport by swapping data-src to src, with an immediate fallback.
Copy-to-Clipboard for Code Blocks
Adds a hover-activated Copy button to every pre>code element, with clipboard API and execCommand fallback.
Open External Links in New Tab
Automatically adds target=_blank and rel=noopener noreferrer to all links pointing to external domains.