50 useful WordPress snippets.
Ready to use.
Useful improvements for content, usability, accessibility, security, performance and everyday site management.
Choose a snippet
Each download includes the code, licence details and short setup notes.
Automatic Copyright Year
Keeps your footer year current without editing it every January.
Back To Top Button
Adds a discreet floating button after visitors scroll down the page.
Reading Progress Bar
Shows a slim progress line as visitors move through longer pages.
Estimated Reading Time
Calculates an estimated reading time from the current post content.
Last Updated Date
Displays the most recent edit date for posts and useful guides.
Copy Link Button
Lets visitors copy the current page address with a single click.
Print Page Button
Adds a simple print control for guides, instructions and reference pages.
Smooth Anchor Scrolling
Makes jumps between page sections feel smoother and easier to follow.
Sticky Mobile Contact Button
Keeps a clear contact button visible near the bottom of smaller screens.
Click-To-Call Telephone Link
Creates a mobile-friendly telephone link without writing HTML each time.
Email Address Protection
Uses WordPress obfuscation to hide basic email addresses from simple harvesters.
Disable Image Attachment Pages
Redirects thin attachment pages back to their parent content or homepage.
Remove WordPress Version Number
Stops the generator tag exposing the installed WordPress version.
Disable XML-RPC
Turns off XML-RPC when your website does not need that legacy interface.
Block Author Username Enumeration
Blocks simple ?author= requests that can reveal public author login names.
Lightweight Login Throttling
Adds a small delay after repeated failed logins to reduce basic brute-force attempts.
Disable Comments Completely
Removes comments from websites that never use them.
Disable WordPress Emoji Scripts
Removes WordPress emoji scripts and styles when your site does not need them.
Remove Asset Query Strings
Removes version query strings from local CSS and JavaScript asset URLs.
Lazy-Load Embedded Videos
Adds native lazy loading to iframe embeds such as YouTube and Vimeo.
Responsive Video Embeds
Keeps embedded videos within their container on smaller screens.
Add Missing Image Dimensions
Adds width and height to local content images when WordPress can identify them.
Safer External Links
Adds noopener and noreferrer to external links that open in new tabs.
Automatic Table Of Contents
Builds a simple table of contents from H2 headings inside a post.
Simple Maintenance Mode
Shows visitors a clean 503 message while administrators can still access the site.
Native Share Button
Adds a share button using the device share menu, with a copy-link fallback.
Copy Buttons For Code Blocks
Adds a small copy button to code blocks so visitors can copy examples quickly.
Heading Anchor Links
Adds stable IDs and small link controls to H2 and H3 headings in post content.
Sticky Header Anchor Offset
Stops anchor links hiding section headings behind a sticky website header.
Skip To Content Link
Adds a keyboard-accessible skip link for visitors who bypass repeated navigation.
Clear Keyboard Focus Styles
Makes keyboard focus easier to see on links, buttons and form controls.
Reduced Motion Support
Respects visitors who request reduced animation through their device accessibility settings.
Click-To-Email Link
Creates reusable email links without writing mailto HTML each time.
WhatsApp Contact Link
Creates a WhatsApp contact link using your number and an optional prepared message.
Directions Link
Creates a Google Maps directions link from any address you enter.
Announcement Bar
Adds a simple announcement bar for notices, offers, closures or important updates.
Reusable Callout Box
Adds tidy information, warning or tip boxes inside posts and pages.
Simple Accordion
Creates accessible expandable sections without loading an extra JavaScript library.
Post Word Count
Shows the word count for the current post through a simple shortcode.
Relative Last Updated Date
Displays how recently a post changed, such as “Updated 4 days ago”.
Simple Image Lightbox
Opens unlinked content images in a clean full-screen viewer when visitors click them.
Responsive Tables
Lets wide content tables scroll horizontally instead of breaking smaller screen layouts.
Duplicate Post Or Page
Adds a Duplicate link to posts and pages for creating editable copies quickly.
Featured Image Admin Column
Shows each post or page featured image directly inside the WordPress list screen.
Last Modified Admin Column
Shows when each post or page was last edited from the main content list.
Post And Page ID Column
Displays WordPress content IDs directly in the admin list without opening each item.
Hide Admin Notices From Non-Admins
Keeps plugin and update notices away from editors who cannot act on them.
Disable Theme And Plugin File Editor
Removes WordPress dashboard file editing to reduce accidental or unauthorised code changes.
Generic Login Error Messages
Stops login errors confirming whether a particular username exists.
Disable Self Pingbacks
Stops WordPress creating pingbacks when your own posts link to each other.
These snippets are provided under GPL-2.0-or-later. Themes, plugins and hosting setups can behave differently.
Take a current backup first. Test changes on staging where possible, especially security and performance snippets.