Snippet library
WordPress code snippets, ready to use.
707 free & Pro snippets and modules. Copy-paste-ready, or import in one click with SnipCraft.
Enqueue a Custom Editor-Only Stylesheet
Loads a theme stylesheet only inside the block editor so you can fine-tune typography and spacing without affecting the front end.
Add Theme Support for Editor Styles and Wide Alignment
Declares editor-styles, align-wide, and responsive-embeds theme support so the block editor applies the active theme stylesheet and enables wide/full-width alignment controls.
Register Custom Block Pattern Category
Registers a "Site Layouts" block pattern category so custom patterns registered with that slug appear in their own section of the pattern inserter.
Unregister Unwanted Core Block Styles
Removes the built-in Fill, Outline (button), Rounded (image), and decorative separator block styles to keep the editor style panel tidy.
Set Site Name and No-Reply From Address for wp_mail
Overrides the default WordPress email sender name with the site name and the from address with a noreply@ address derived from the site domain.
Register Custom WP-Cron Intervals
Adds "Every 15 Minutes" and "Twice Daily" schedule intervals to the WP-Cron system for use with wp_schedule_event().
Allow WebP and AVIF Image Uploads
Adds WebP and AVIF to WordPress allowed upload MIME types so modern image formats can be uploaded through the media library.
Force Attachment Pages to Download File
Intercepts attachment page requests and serves the attached file as a forced browser download instead of displaying the page.
Disable WordPress Big Image Size Threshold
Prevents WordPress from down-scaling large uploaded images by disabling the 2560px big-image threshold.
Auto-Set Image Alt Text from Filename
Automatically populates the alt text meta for newly uploaded images using the sanitized attachment filename.
Register Custom Image Size (Editor-Selectable)
Registers a 600x400 hard-cropped "Card" image size and adds it to the block editor image size dropdown.
Add Custom Field to WooCommerce Checkout
Adds an optional "Order Notes Extra" text field to the checkout form, saves it as order meta, and displays it in the admin order view.
Hide WooCommerce Prices and Add-to-Cart for Guest Users
Replaces product prices and the Add-to-Cart button with a "Login to see prices" message for non-logged-in visitors.
WooCommerce Minimum Order Amount Enforcement
Prevents checkout and displays a cart notice when the order total falls below a configurable minimum amount.
Redirect to Cart After WooCommerce Add-to-Cart
Skips the "Added to cart" notice and immediately redirects the customer to the cart page after a product is added.
WooCommerce Percentage Sale Badge
Replaces the default "Sale!" product badge with the actual percentage discount (e.g. "-25%").
WooCommerce Free Shipping Progress Notice
Displays a dynamic notice in the cart showing how much more the customer needs to spend to qualify for free shipping.
Add Trust Badge Message Below Add-to-Cart
Inserts a short security / money-back-guarantee trust message directly below the Add-to-Cart button.
Change WooCommerce Related Products Count
Controls how many related products are shown on the single product page (default WooCommerce shows 4).
Custom WooCommerce Out-of-Stock Text
Replaces the default "Out of stock" availability text with a custom message on product pages.
Custom WooCommerce Thank-You Page Message
Displays a personalised thank-you message with the customer's first name on the order confirmation page.
Remove All WooCommerce Product Data Tabs
Hides the Description, Additional Information, and Reviews tabs from the single product page.
Change WooCommerce Add-to-Cart Button Text
Replaces the default "Add to cart" button label with "Buy Now" on both single product and archive pages.
Responsive Embed Wrapper via the_content
Wraps iframes and embeds (YouTube, Vimeo, etc.) found in post content in a responsive aspect-ratio container.