25% off ProSNIPC25OFF

Snippet library

WordPress code snippets, ready to use.

707 free & Pro snippets and modules. Copy-paste-ready, or import in one click with SnipCraft.

PHP

Remove Admin Color Scheme Picker

Hides the color scheme picker from user profile pages to enforce a consistent admin theme.

#admin#cleanup#color-scheme
PHP

Disable Site Health Widget and Page

Removes the Site Health dashboard widget and hides the Site Health submenu link from wp-admin.

#admin#cleanup#dashboard
PHP

Sort Plugins List Active First

Reorders the Plugins admin list so active plugins appear at the top, making status scanning faster.

#admin#list-table#plugins
PHPPro

Hide Admin Menu Items by Role

Removes specified top-level admin menu pages for non-administrator users to declutter their dashboard.

#access-control#admin#customization
PHPPro

Reorder Admin Menu Items

Sets a custom top-level order for the WordPress admin navigation menu using the menu_order filter.

#admin#customization#menu
PHP

Add User Role Column to Users List

Appends a Role column to the Users list table for quick role visibility without opening each profile.

#admin#columns#roles
PHP

Add Registration Date Column to Users

Adds a sortable Registered date column to the Users list table formatted with the site date setting.

#admin#columns#registration
PHP

Add Image Dimensions Column to Media

Shows width × height in pixels for image attachments in a dedicated Media Library list column.

#admin#columns#dimensions
PHP

Add File Size Column to Media Library

Displays the file size of each attachment in a new column on the Media Library list view.

#admin#columns#file-size
PHP

Add Last Modified Column to Posts

Appends a sortable Last Modified date column to the Posts list table in wp-admin.

#admin#columns#list-table
PHP

Add Post and Page ID Column

Adds a numeric ID column to the Posts and Pages list tables so editors can quickly copy IDs.

#admin#columns#list-table
HTMLPro

Newsletter Signup Form Markup

A styled newsletter opt-in section with first name and email fields, AJAX submission via wp_ajax, and inline feedback.

#email#form#html
HTML

Schema.org Breadcrumb Markup

Accessible breadcrumb navigation with BreadcrumbList microdata for structured data and correct ARIA labelling.

#breadcrumb#html#navigation
HTMLPro

FAQ Page Schema JSON-LD

Embeds structured FAQ data as JSON-LD schema markup to enable rich results in Google Search.

#faq#json-ld#schema
HTMLPro

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.

#facebook#html#share
HTML

Call-to-Action Banner

A full-width promotional CTA section with a heading, supporting text, and two action buttons (primary and secondary).

#banner#conversion#cta
HTML

Cookie Notice Banner Markup

A fully functional GDPR-style cookie notice banner with Accept/Decline buttons, persisted via localStorage.

#banner#cookie#gdpr
JavaScript

Current Year Auto-Update

Replaces the text content of elements with class current-year or a data-current-year attribute with the live year.

#copyright#date#footer
JavaScriptPro

Reading Progress Bar

Injects a fixed top progress bar that fills as the user scrolls through the page, using requestAnimationFrame for performance.

#javascript#progress#reading
JavaScriptPro

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.

#animation#header#javascript
JavaScript

Auto-Resize Textareas

Dynamically expands any textarea to fit its content as the user types, eliminating the need to scroll inside the field.

#auto-resize#forms#javascript
JavaScriptPro

Lazy-Load Iframes via IntersectionObserver

Defers iframe loading until the element enters the viewport by swapping data-src to src, with an immediate fallback.

#iframe#intersection-observer#javascript
JavaScriptPro

Copy-to-Clipboard for Code Blocks

Adds a hover-activated Copy button to every pre>code element, with clipboard API and execCommand fallback.

#clipboard#code#copy
JavaScript

Open External Links in New Tab

Automatically adds target=_blank and rel=noopener noreferrer to all links pointing to external domains.

#external#javascript#links