Snippet library
WordPress code snippets, ready to use.
707 free & Pro snippets and modules. Copy-paste-ready, or import in one click with SnipCraft.
Register Project Type Custom Taxonomy
Registers a hierarchical "Project Type" taxonomy attached to Portfolio and post types with REST API support.
Register Portfolio Custom Post Type
Registers a "Portfolio" custom post type with archive support, REST API visibility, and a portfolio dashicon.
Auto-Add target="_blank" and rel to External Links
Automatically adds target="_blank" and rel="noopener noreferrer" to all external links found in post content.
Related Posts by Category Appended to Content
Appends a list of related posts from the same categories at the end of single post content.
Estimated Reading Time Shortcode
Adds a [reading_time] shortcode that calculates and displays estimated reading time based on word count.
Back-to-Top Anchor Appended to Post Content
Appends a "Back to top" anchor link at the end of single post content via the_content filter.
Enable Shortcodes in Widgets and Excerpts
Allows shortcodes to be processed inside Classic Widget text blocks and post excerpt fields.
Site Name and URL Shortcode
Adds a [site_name] shortcode that outputs the site name as plain text or a linked anchor with link="yes".
Current Year Shortcode
Adds a [current_year] shortcode that outputs the current four-digit year, useful for copyright notices.
Custom "Read More" Excerpt Link
Replaces the default […] excerpt suffix with a styled "Read more →" link to the full post.
Custom Excerpt Length
Sets the default WordPress excerpt word count to 25 words via the excerpt_length filter.
Mailchimp for WP: Redirect After Successful Sign-Up
Redirects the visitor to a custom thank-you page after a successful Mailchimp for WP form submission instead of showing the inline success message.
Mailchimp for WP: Auto-Populate a Source Field on Sign-Up
Automatically appends the page URL as a SOURCE merge field to every Mailchimp for WP form submission so you can track which page each subscriber used.
BuddyPress: Redirect Profile Tab to Activity Feed
Redirects visitors away from the default BuddyPress profile public tab to the member's activity feed, making activity the first thing displayed on profile pages.
bbPress: Change Topics Per Page
Overrides the number of topics displayed per page in bbPress forum listings by filtering the bbp_get_topics_per_page value.
bbPress: Auto-Close Stale Topics via Scheduled Task
Registers a daily WP-Cron event that automatically closes any bbPress topics older than a configurable number of days to reduce forum maintenance.
LearnDash: Auto-Enroll New Users in a Free Course
Automatically enrolls every newly registered user into a specified LearnDash course ID, ideal for an onboarding or free introductory course.
LearnDash: Redirect User After Course Completion
Fires on the learndash_course_completed action and redirects the student to a configurable thank-you or next-steps page when they finish a course.
MemberPress: Customize the Post-Login Redirect for Members
Redirects members to a custom dashboard page after logging in via MemberPress, while sending admins to wp-admin and non-members to the default redirect.
MemberPress: Redirect Non-Members Away from Protected Content
Checks MemberPress access rules on singular posts and redirects any user without access to the login page, preserving the intended destination URL.
The Events Calendar: Override the Default Events Slug
Changes the public URL slug used for the events archive (e.g. /events/ → /whats-on/) via the tribe_events_rewrite_slugs filter without touching plugin settings.
The Events Calendar: Sort Event Archive by Start Date
Forces the main Events Calendar archive to order events by start date ascending so upcoming events always appear first, overriding any default sort.
The Events Calendar: Change Events Per Page
Overrides the Events Calendar events-per-page setting via filter so you can control the listing count in code without visiting the plugin settings.
Rank Math: Remove the Admin Bar Node
Removes the Rank Math SEO node from the WordPress admin bar so it no longer appears on the front end or in wp-admin.