Snippet library
WordPress code snippets, ready to use.
707 free & Pro snippets and modules. Copy-paste-ready, or import in one click with SnipCraft.
Elementor: Disable Default Typography Presets
Stops Elementor from loading its built-in typography presets so the active theme's font stack is not overridden.
Elementor: Disable Default Color Palettes
Prevents Elementor from injecting its built-in default color scheme so the site's own global colors remain the sole source of truth.
Elementor: Register Custom Theme Builder Location
Registers a custom Theme Builder template location (hero slot) that Elementor Pro templates can target and render in the theme.
Elementor: Filter Posts Widget Query by Query ID
Modifies the WP_Query for a specific Elementor Posts/Archive widget by matching the Query ID set in the widget Content panel.
Elementor: Register Custom Widget Category
Adds a custom group category to the Elementor widget panel so bespoke widgets can be visually separated from built-in ones.
Add a Send Test Email Admin Tool
Adds a Tools > Test Email page in the WordPress admin where site administrators can send a test email to verify SMTP and mail-server deliverability.
Hide Admin Update Notifications (Keep Emails)
Suppresses core, plugin, and theme update nags in the WordPress dashboard for users who cannot perform updates, while leaving background email alerts intact.
Change WooCommerce Order Email Recipients
Routes WooCommerce new-order, cancelled-order, and failed-order emails to additional recipients defined via a filterable list, including the admin address.
Customize WooCommerce Email Footer Text
Replaces the default WooCommerce email footer text with your brand name and site URL using a simple filter.
Phone Number Input Mask for Forms
Applies a live (999) 000-0000 US phone number mask to all telephone inputs on the page as the user types, with no jQuery dependency.
Enable Pinch-to-Zoom on Mobile
Replaces any restrictive viewport meta tag (one that sets user-scalable=no or maximum-scale=1) with a permissive one that allows pinch-to-zoom.
CSS Floating Form Labels
Provides a complete material-style floating label pattern: the label slides up and shrinks when the input receives focus or contains a value.
Warn Before Leaving a Form with Unsaved Changes
Shows a browser "leave page?" warning when a user navigates away from any form that has been edited but not submitted.
Add a "Scrolled" Class to Body on Scroll
Adds a "scrolled" CSS class to the <body> element once the page is scrolled past a configurable threshold, enabling CSS-driven sticky header or nav changes.
Fade-In Page Transitions
Fades the page out before navigating to a same-origin link and fades it back in on load, creating smooth cross-page transitions without a framework.
Disable Right-Click and Text Copying
Suppresses right-click context menus and clipboard copy events across the page to provide basic content-copy protection.
Add Show/Hide Password Toggle to Login Form
Appends a Show / Hide button beside the password field on the WordPress login page so users can reveal their password while typing.
Logout Confirmation Prompt
Intercepts clicks on logout links site-wide and shows a browser confirm dialog before completing the sign-out request.
Remove Default Author Contact Method Fields
Removes the legacy AIM, Yahoo IM, and Jabber/XMPP contact method rows from the WordPress user profile screen.
Add Custom Profile Fields for Users
Adds arbitrary editable text fields (job title, company, phone) to the WordPress user profile and stores each value as user meta.
Add Social Media Links to User Profiles
Adds Twitter/X, LinkedIn, and GitHub URL fields to the WordPress user profile screen and saves them as user meta.
Set Display Name to Username on Registration
Sets new users' display name to their login username on registration so their real name is not exposed publicly by default.
Redirect Users to the Previous Page After Login
Sends users back to the page they were visiting before the login form, falling back to the default WordPress redirect when no referer exists.
Add VideoObject Schema for Embedded Videos
Detects the first YouTube or Vimeo embed in a singular post and outputs a JSON-LD VideoObject schema block to enable video rich results.