Snippet library
WordPress code snippets, ready to use.
707 free & Pro snippets and modules. Copy-paste-ready, or import in one click with SnipCraft.
Defer Non-Critical CSS Loading
Converts specified stylesheet handles to rel="preload" links with an onload swap, removing them from the render-blocking path.
Minify HTML Output
Strips unnecessary whitespace and blank lines from the HTML response to reduce page size, preserving pre/script/style/textarea content verbatim.
Disable WP-Cron and Use a Server Cron
Prevents WordPress from spawning its built-in cron on every page load and includes setup notes for a real server cron job.
Add a Custom Field Column to a Post List
Adds a sortable meta-value column to the admin post list table for any post type and meta key.
Display Current Post's Taxonomy Terms via Shortcode
Shortcode [post_terms taxonomy="category"] lists the terms of any taxonomy assigned to the current post.
Make a Taxonomy Single-Select with Radio Buttons
Replaces the default taxonomy checkbox meta box with a radio-button list that enforces single-term selection.
Register a Custom Post Status
Registers an 'Archived' post status for posts and pages, and adds it to the Classic Editor status dropdown.
Add rel="sponsored" to Affiliate Links
Rewrites outbound links with the CSS class 'affiliate' or matching configured domains to carry rel="sponsored noopener".
CSS Drop Cap on the First Paragraph
Applies a decorative large drop cap to the first letter of the opening paragraph on single posts and pages.
Display Post Word Count Shortcode
Shortcode [word_count] displays the total word count of the current or any specified post.
Formatted Date and Time Shortcode
Shortcode [current_date] outputs the current date/time in the site's timezone using any PHP date format.
Display a Custom Field Value via Shortcode
Shortcode [custom_field key="field_name"] outputs the value of any post meta field inline.
Auto-Link Keywords to Internal Pages
Automatically hyperlinks the first occurrence of configured keywords to their target URLs in post content.
Auto-Insert Affiliate Disclosure on Posts
Prepends a compliance disclosure notice to any post tagged with the 'affiliate' tag.
Add Anchor Links to Headings Automatically
Adds a clickable # anchor link beside every h2–h4 heading in post content for easy linking.
Auto-Generate Excerpt from Post Content
Generates a trimmed excerpt from the post body when no manual excerpt has been written.
Show Post Count in Category and Tag Titles
Appends the post count in parentheses to category, tag, and custom taxonomy archive titles.
Display Archive and Term Description on Archives
Outputs the term or author description block above the post list on archive pages.
Exclude a Category from the Blog Homepage Loop
Removes a specified category from the main blog and front-page feed using pre_get_posts.
Insert Content After the Last Paragraph
Injects a configurable CTA block immediately after the last paragraph on single posts.
Show Featured Image in Archive Post Lists
Prepends the post thumbnail to excerpts on archive, category, tag, and search results pages.
Show Both Published and Modified Dates
Appends both the original publish date and the last-modified date below single-post content.
Expose Nav Menus via the REST API
Registers a GET /wp-json/scseed/v1/menu?location=primary endpoint that returns the items of a registered navigation menu.
Add a Custom Field to the Users REST Response
Exposes a custom user meta field (job_title) in the WP REST API users endpoint with read and write support.