Snippet library

WordPress snippets that actually work.

Copy-and-paste code for WordPress and WooCommerce, each one explained in plain English and tested on the latest versions.

325snippets
14categories
WP 7.1every snippet tested
PHP 8.3ready

Showing 325 snippets

Privacy PHP Delete Old Completed Privacy Requests Automatically delete export and erasure requests 30 days after they're completed, along with their email addresses. Intermediate WP 7.1 Privacy PHP Anonymise Customer IP Addresses on New Orders Store only a shortened IP address with each new WooCommerce order, like 203.0.113.0 instead of 203.0.113.42. Intermediate WP 7.1 Requires WooCommerce Privacy PHP Anonymise Comments When a User Is Deleted When you delete a user, keep their comments for the conversation but remove their name, email, website and IP address. Intermediate WP 7.1 Accessibility CSS Show Clear Focus Outlines for Keyboard Users Give links, buttons and form fields a strong, visible outline when they're reached with the keyboard, without showing it on mouse clicks. Beginner WP 7.1 Accessibility CSS Turn Off Animations for People Who Prefer Reduced Motion Stop animations, transitions and smooth scrolling for visitors who have turned on "Reduce motion" on their device. Beginner WP 7.1 Accessibility PHP Tell Screen Reader Users When a Link Opens a New Tab Add hidden "(opens in a new tab)" text to links in posts that open in a new tab, so screen reader users aren't surprised. Intermediate WP 7.1
Want it without code?Our plugins do the heavy lifting, with settings, updates and support.
Browse plugins
Accessibility CSS Underline Links in Post Content Underline links inside posts and pages, so they can be spotted without relying on colour alone. Beginner WP 7.1 Accessibility PHP Warn About Images Without Alt Text in the Editor Show a warning in the block editor listing images that have no alt text, so writers can fix them before publishing. Intermediate WP 7.1 Accessibility PHP Stop Videos Autoplaying Remove autoplay from Video and Cover blocks so videos only play when visitors press play, and add controls where they're missing. Beginner WP 7.1 Accessibility CSS Add the Screen Reader Text CSS Add WordPress's standard .screen-reader-text class for themes that are missing it, so hidden labels stay hidden visually but are still read out. Beginner WP 7.1 Accessibility PHP Make Wide Tables Scrollable and Labelled Let wide Table blocks scroll sideways on phones, and make the scroll area reachable and announced for keyboard and screen reader users. Intermediate WP 7.1 Accessibility PHP Add a Skip to Content Link for Accessibility Inject a visually hidden 'Skip to content' link at the top of every page that becomes visible on keyboard focus, allowing keyboard and screen reader users to bypass repeated navigation. Beginner WP 7.1 Accessibility PHP Add ARIA Labels to WordPress Navigation Menus Automatically add descriptive aria-label attributes to WordPress navigation menus based on their registered location, helping screen readers distinguish between multiple nav elements on the same page. Beginner WP 7.1 Email PHP Stop “New User Registration” Emails to the Admin Stop WordPress emailing the site admin every time someone registers, while new users still get their own welcome email. Beginner WP 7.1 Email PHP Stop “Password Changed” Emails to the Admin Stop the site admin getting an email every time a user resets their password. Beginner WP 7.1 Email PHP Stop Plugin and Theme Auto-Update Emails Stop the emails WordPress sends after plugins and themes update automatically, and only get core update emails when something fails. Beginner WP 7.1 Email PHP Send WordPress Email Through SMTP Send all WordPress email through your email provider's SMTP server, with the login details kept in wp-config.php. Intermediate WP 7.1 Email PHP Send All Email to One Address on Staging On non-production sites, send every WordPress email to a test inbox, with the real recipient shown in the subject. Intermediate WP 7.1 Email PHP Block All Outgoing Email on Staging Stop non-production sites sending any email at all, while logging what would have been sent. Beginner WP 7.1 Email PHP Send Comment Moderation Emails to Someone Else Send "Please moderate" comment emails to an editor or a shared inbox instead of the site admin email. Beginner WP 7.1 Email PHP Rewrite the Password Reset Email Replace the plain WordPress password reset email with your own friendly wording and your site's name. Intermediate WP 7.1 Email PHP Customise the New User Welcome Email Change the subject and wording of the email new users get with their "set your password" link. Intermediate WP 7.1 Email PHP Add a Reply-To Address to WordPress Emails Send replies to WordPress emails to your support inbox, even when they're sent from a no-reply address. Beginner WP 7.1 Email PHP Send WordPress Emails as Simple HTML Wrap WordPress's plain-text emails in a clean HTML layout with your site name, readable spacing and clickable links. Intermediate WP 7.1 Privacy PHP Use Initials Avatars Instead of Gravatar Replace Gravatar images with coloured initials made on your own site, so visitors' email hashes are never sent to Gravatar. Intermediate WP 7.1 Privacy PHP Use YouTube’s Privacy-Enhanced Mode for Embeds Switch every YouTube embed to youtube-nocookie.com, which doesn't set tracking cookies until the visitor plays the video. Beginner WP 7.1 Privacy PHP Load Video Embeds Only When Clicked Show a placeholder with a "Load video" button instead of YouTube and Vimeo iframes, so nothing loads from them until the visitor agrees. Intermediate WP 7.1 Privacy PHP Stop Saving Comment Cookies Stop WordPress saving commenters' name, email and website in cookies, and remove the "Save my name" checkbox. Beginner WP 7.1 Privacy PHP Remove the Website Field From Comments Remove the Website field from the comment form and ignore any website address that's sent anyway, reducing personal data and link spam. Beginner WP 7.1 Privacy PHP Add a Privacy Consent Checkbox to Comments Require visitors to tick "I agree to the privacy policy" before their comment is accepted. Intermediate WP 7.1 Privacy PHP Remove Google Fonts From the Font Library Remove the Google Fonts collection from the Site Editor's font library, so nobody installs fonts from Google by mistake. Beginner WP 7.1 Privacy PHP Stop Storing IP Addresses With Login Sessions Stop WordPress saving each logged-in user's IP address and browser details in their session records. Beginner WP 7.1 Privacy PHP Include Custom User Fields in Privacy Exports and Erasures Add your own user fields, like phone or job title, to WordPress's Export Personal Data and Erase Personal Data tools. Intermediate WP 7.1 Privacy PHP Stop Storing the Browser Details of Commenters Stop WordPress saving each commenter's browser and device details (user agent) with their comment. Beginner WP 7.1 Email PHP Log Every Email WordPress Sends Keep a 30-day log of every email WordPress tries to send, with the recipient, subject, result and error message, in a small database table. Advanced WP 7.1 Privacy PHP Auto-Anonymize Old Comment IP Addresses Automatically anonymize the stored IP addresses of comments older than a configurable number of days, reducing personal data retention without deleting the comments themselves. Intermediate WP 7.1 Privacy PHP Remove IP Address from Comments on Save Prevent WordPress from storing the commenter's IP address at all by clearing it before the comment is written to the database. Beginner WP 7.1 Media PHP Clean Up File Names on Upload Turn uploaded file names like "Café Menu FINAL (2).JPG" into clean, lowercase, URL-safe names like "cafe-menu-final-2.jpg". Beginner WP 7.1 Media PHP Set a Smaller Upload Size Limit for Some Roles Limit authors and contributors to 2 MB uploads while administrators keep the server's full limit. Beginner WP 7.1 Media PHP Change the Size WordPress Scales Large Images To Change the 2560 px limit WordPress uses to scale down huge uploaded photos, for example to 1920 px. Beginner WP 7.1 Media PHP Convert JPEG and PNG Uploads to WebP Make WordPress save the resized versions of uploaded JPEG and PNG images as WebP, which is usually 25–35% smaller. Intermediate WP 7.1 Media PHP Add Your Own Image Size to the Editor Register a custom image size, like a 1200×630 social card, and make it selectable in the Image block's Resolution menu. Beginner WP 7.1 Media PHP Keep All Uploads in One Folder Stop WordPress sorting uploads into year and month folders, so new files go straight into /wp-content/uploads/. Beginner WP 7.1 Media PHP Add File Size and Dimensions Columns to the Media Library Show each file's size and image dimensions in the Media Library list view, so you can spot oversized uploads at a glance. Beginner WP 7.1 Media PHP Reject Images That Are Too Small or Too Large Block image uploads below 600 px wide or above 6000 px on either side, with a clear message explaining why. Intermediate WP 7.1 Media PHP Allow Extra File Types in the Media Library Let administrators upload file types WordPress blocks by default, such as subtitle files (.vtt), JSON or 3D models (.glb). Intermediate WP 7.1 Media PHP Let Authors See Only Their Own Media Show authors and contributors only the files they uploaded, in both the Media Library and the "Add media" picker. Intermediate WP 7.1 Media PHP Stop Images Linking to the File by Default Make new images in posts have no link by default, instead of linking to the full-size file or attachment page. Beginner WP 7.1 Media PHP Add a Photo Credit Field to Media Add a "Credit" field to images in the Media Library, and show it under featured images and in image captions. Intermediate WP 7.1 Media PHP Turn On Lightbox for All Images Make every Image block open in a full-screen lightbox when clicked, using WordPress's built-in "Expand on click" feature. Beginner WP 7.1 Media PHP Serve Media Files From a CDN Domain Rewrite image and file URLs from your uploads folder to a CDN or media subdomain, such as cdn.example.com. Intermediate WP 7.1 Media PHP Show Images Missing Alt Text in the Media Library Add an "Alt text" column to the Media Library list that flags images with no alt text, and a filter to show only those. Beginner WP 7.1 Media PHP Remove Unused Generated Image Sizes Stop WordPress from generating image size variants that your theme and plugins never use, reducing disk usage and speeding up media uploads. Beginner WP 7.1 Media PHP Allow Safe SVG Uploads for Admins Let administrators upload SVG files, with each file rebuilt from an allowlist so scripts, event handlers and external links never get through. Advanced WP 7.1 Email PHP Change the WordPress From Name and Email Address Replace "WordPress" and wordpress@yourdomain with your own sender name and address on every email WordPress sends. Beginner WP 7.1 Email PHP Disable Comment Notification Emails Stop WordPress from sending email notifications to post authors and administrators whenever a new comment is submitted or held for moderation. Beginner WP 7.1 Email PHP BCC All Outgoing WordPress Emails Add a hidden BCC recipient to every email sent through wp_mail() for auditing, testing, or monitoring all outgoing WordPress transactional mail. Intermediate WP 7.1 Content & Posts PHP Only Search Blog Posts Limit your site search to blog posts, so pages like Cart, Checkout or Thank You don't clutter the results. Beginner WP 7.1 Content & Posts PHP Run Shortcodes in Excerpts Make shortcodes typed into a post's Excerpt box work, instead of showing as raw [shortcode] text on archives. Beginner WP 7.1 Content & Posts PHP Go Straight to the Post When Search Finds One Result When a site search returns exactly one result, send the visitor straight to it instead of a results page with one link. Beginner WP 7.1 REST API & Developer PHP Show Current Template Filename in the Admin Bar Display the name of the PHP template file being used to render each page in the WordPress admin bar, making it instant to identify which template file to edit. Beginner WP 7.1 REST API & Developer PHP Display Query Count and Load Time in the Footer Show the number of database queries and total page load time in the front-end footer for administrators, giving instant performance feedback during development. Beginner WP 7.1 REST API & Developer PHP Add the Featured Image URL to the REST API Add a featured_image_url field to posts in the REST API, so apps and headless front ends don't need a second request for the image. Beginner WP 7.1 REST API & Developer PHP Make a Custom Field Available in the REST API Register a post meta field so it can be read and saved through the REST API and used by block editor sidebars. Intermediate WP 7.1 REST API & Developer PHP Allow More Than 100 Items per REST Request Raise the REST API's 100-item limit for one post type, so a script or app can fetch more items in a single request. Intermediate WP 7.1 REST API & Developer PHP Only Allow REST API Requests From Your Own Domains Replace WordPress's "any origin" CORS headers with a list of domains allowed to call your REST API from a browser. Advanced WP 7.1 REST API & Developer PHP Let Browsers and CDNs Cache Public REST Responses Add Cache-Control headers to public, logged-out REST API GET requests, so headless sites and CDNs can cache them for a few minutes. Intermediate WP 7.1 REST API & Developer PHP Log Errors to a Private File Turn on WordPress debug logging, hide errors from visitors and write the log to a folder that can't be opened in a browser. Intermediate WP 7.1 REST API & Developer PHP Log Slow Database Queries Write any database query that takes longer than 50 ms to the PHP error log, with the function that ran it. Advanced WP 7.1 REST API & Developer PHP Add a Custom Cron Interval and Scheduled Task Add a "Every 15 minutes" schedule to WP-Cron and use it to run your own task in the background. Intermediate WP 7.1 REST API & Developer PHP List Scheduled Cron Events Under Tools Add a read-only Tools > Cron Events page that lists every scheduled WP-Cron task, when it runs next and how often. Intermediate WP 7.1 REST API & Developer PHP Add Your Own Site Health Check Add a test to Tools > Site Health that warns when plugins your site depends on, like backups or security, are not active. Intermediate WP 7.1 REST API & Developer PHP Add Your Own Section to Site Health Info Add a "Site setup" section to Tools > Site Health > Info with details you want in every support report. Beginner WP 7.1 REST API & Developer PHP Add a Custom WP-CLI Command Create your own wp command, like wp nahnu cleanup, to run site maintenance tasks from the terminal. Intermediate WP 7.1 REST API & Developer PHP Register and Use a Custom Query Variable Let WordPress recognise your own URL parameter, like ?ref=partner, and read it safely anywhere with get_query_var(). Intermediate WP 7.1 REST API & Developer PHP Add a Custom URL Endpoint to Posts Add /print/ to the end of any post URL to show a clean, printer-friendly version, using a WordPress rewrite endpoint. Advanced WP 7.1 REST API & Developer PHP Handle an AJAX Request Securely A complete, safe pattern for an admin-ajax.php request: a nonce, a capability check, cleaned input and a JSON response. Intermediate WP 7.1 REST API & Developer PHP Set the Environment Type for Staging Sites Tell WordPress and plugins whether a site is production, staging, development or local, so they can behave differently. Beginner WP 7.1 Media PHP Disable WordPress Attachment Pages Redirect standalone attachment pages to their parent post or the homepage to eliminate thin content pages that waste crawl budget and dilute SEO. Beginner WP 7.1 Media PHP Set JPEG Compression Quality Override WordPress's default JPEG quality setting of 82 to control the file size and visual quality balance for all uploaded and regenerated images. Beginner WP 7.1 Media PHP Auto-Set Image Alt Text from Filename on Upload Automatically populate the alt text field for newly uploaded images using a cleaned-up version of the filename, so images are never missing alt text by default. Beginner WP 7.1 Users & Login PHP Add a Sortable Registered Date Column to Users Show when each user signed up in the Users list, and click the column to sort newest or oldest first. Beginner WP 7.1 Users & Login PHP Set the Role for New Users in Code Lock the "New User Default Role" setting so new sign-ups always get the role you choose, even if someone changes the setting. Beginner WP 7.1 Users & Login PHP Stop Users Changing Their Own Email Address Only let administrators change a user's email address, so members and customers can't switch their account to a different email. Intermediate WP 7.1 Users & Login PHP Turn Off Password Resets for Administrators Block the "Lost your password?" reset for administrator accounts, so a hacked email inbox can't be used to take over the site. Intermediate WP 7.1 Users & Login PHP Add a Login Form Shortcode Put a WordPress login form on any page with [nahnu_login_form], and show a welcome message to users who are already logged in. Beginner WP 7.1 Users & Login PHP Log Users Out of Other Devices When They Log In Allow one active login per account. Logging in on a new device ends the sessions on every other device. Intermediate WP 7.1 Users & Login PHP Remove the Language Switcher From the Login Page Hide the language dropdown that appears under the login form when more than one language is installed. Beginner WP 7.1 Content & Posts PHP Related Posts by Category Without a Plugin Query and return related posts from the same category as the current post, with a simple caching layer to avoid repeat database queries on popular posts. Intermediate WP 7.1 Content & Posts PHP Register Custom Post Statuses Add custom statuses like 'In Review' and 'Approved' to the post editing workflow, giving editorial teams a structured approval process beyond WordPress's default Draft and Published states. Intermediate WP 7.1 Content & Posts PHP Fix Missed Scheduled Posts on Shared Hosting Trigger WordPress's missed schedule check on every front-end page load so scheduled posts publish reliably on shared hosting where WP-Cron doesn't fire consistently. Intermediate WP 7.1 Content & Posts PHP Add a Table of Contents to Long Posts Automatically add a linked table of contents above the first heading of any post with three or more H2 or H3 headings. Intermediate WP 7.1 Content & Posts PHP Set the First Image as the Featured Image When a post is saved without a featured image, use the first image in its content automatically. Intermediate WP 7.1 Content & Posts PHP Require a Featured Image Before Publishing Disable the Publish button in the block editor until a featured image is set, with a notice telling the writer why. Intermediate WP 7.1 Content & Posts PHP Add a Call-to-Action Box After Every Post Add the same box to the end of every blog post, such as a newsletter sign-up or a link to your products. Beginner WP 7.1 Content & Posts PHP Close Comments on Media Attachments Stop comments on image and file attachment pages, a common target for spam bots. Beginner WP 7.1 Content & Posts PHP Rename “Posts” to “Articles” in the Admin Change the word "Posts" to "Articles", "News" or anything else throughout the admin menu, screens and buttons. Beginner WP 7.1 Content & Posts PHP Add Categories and Tags to Pages Let pages use categories and tags like posts do, and include them in category and tag archives. Beginner WP 7.1 Content & Posts PHP Set a Custom Excerpt Length and Read More Text Override WordPress's default 55-word excerpt length and replace the generic [...] truncation string with a custom word count and a styled read more link. Beginner WP 7.1 Content & Posts PHP Disable Comments Site-Wide Completely disable WordPress comments across all post types, closing existing comments, removing the menu items, and hiding all comment-related UI from the admin. Beginner WP 7.1 Content & Posts PHP Disable Self-Pings on Your Own Posts Prevent WordPress from sending a pingback to itself when you link to your own content in a post, eliminating unnecessary internal self-pings that clutter your comments moderation queue. Beginner WP 7.1 Content & Posts PHP Limit Post Revisions Globally Cap the number of post revisions WordPress stores per post to prevent the wp_posts table from growing indefinitely on sites with frequent content edits. Beginner WP 7.1 Content & Posts PHP Redirect a Specific Page to an External URL Redirect a WordPress page or post to an external URL using a custom field, enabling marketing redirects, affiliate links, and campaign tracking URLs managed from the admin without touching code. Beginner WP 7.1 Block Editor PHP Use the Classic Widgets Screen Bring back the classic Appearance > Widgets screen and Customizer widgets instead of the block-based widget editor. Beginner WP 7.1 Block Editor PHP Add a Custom Block Category Add your own category to the block inserter, ready to hold the custom blocks you build for a site. Beginner WP 7.1 Block Editor PHP Use the Block Editor for a Custom Post Type Switch a plugin's custom post type that opens in the classic editor over to the block editor. Beginner WP 7.1 Block Editor PHP Turn Off Drop Caps and Custom Typography Remove the drop cap toggle and custom letter spacing, text decoration and font style controls from paragraphs. Beginner WP 7.1 Block Editor PHP Set the Default Size for New Image Blocks Make new Image blocks use the Large size (or any registered size) instead of the full-size original. Beginner WP 7.1 Users & Login PHP Let Users Log In With Email Only Stop people logging in with a username, so only an email address and password work on the login form. Beginner WP 7.1 Users & Login PHP Tick “Remember Me” by Default Pre-tick the "Remember Me" box on the login form so users stay logged in for two weeks instead of until they close the browser. Beginner WP 7.1 Users & Login PHP Redirect Users After They Log Out Send people to your home page, or any page you choose, after they log out instead of the "You are now logged out" screen. Beginner WP 7.1 Users & Login PHP Add a Log In / Log Out Link to a Menu Add a link to your main menu that says "Log in" for visitors and "Log out" for logged-in users. Beginner WP 7.1 Users & Login PHP Show a Message on the Login Page Add a short message above the login form, such as a support link or a notice about scheduled maintenance. Beginner WP 7.1 Users & Login PHP Add a Custom Field to User Profiles Add an extra field, like a job title or phone number, to the user profile screen and save it with the user. Intermediate WP 7.1 Users & Login PHP Hide the Login Page Behind a Secret Link Make wp-login.php return a 404 unless the visitor arrives through your secret link, without breaking logouts, password resets or saved logins. Intermediate WP 7.1 Users & Login PHP Log Failed Login Attempts to the Database Record every failed login with username, IP address and browser in a small database table, and clear out entries older than 90 days automatically. Advanced WP 7.1 Users & Login PHP Remove the Admin Bar for Non-Admin Users Hide the WordPress admin toolbar on the front end for any user who isn't an administrator, keeping the public-facing site clean for logged-in subscribers, customers, and members. Beginner WP 7.1 Users & Login PHP Show Last Login Date in the Users Table Record when each user last logged in and show it as a sortable column on the Users screen, in your site's timezone. Intermediate WP 7.1 Users & Login PHP Make the Whole Site Members-Only Force all unauthenticated visitors to the WordPress login page, useful for membership sites, intranets, client preview sites, and staging environments. Intermediate WP 7.1 Users & Login PHP Redirect After Login Based on User Role Send users to different URLs after login depending on their role, administrators go to the dashboard, customers go to My Account, and subscribers go to a custom page. Intermediate WP 7.1 Users & Login PHP Custom Login Page Logo, URL, and Styles Replace the WordPress logo, link, and tooltip on the login page with your own brand, and add custom CSS to match your site's colour scheme, a standard white-label step for client site handoffs. Beginner WP 7.1 SEO PHP Delay Posts in the RSS Feed Hold new posts out of your RSS feed for 10 minutes after publishing, so you have time to fix mistakes before feed readers and scrapers grab them. Intermediate WP 7.1 SEO PHP Use Pretty Search URLs Redirect search results from ?s=term to /search/term/, which is cleaner to share and easier for caches and analytics. Intermediate WP 7.1 SEO PHP Remove Stop Words From New Post Slugs Shorten the URL WordPress creates from a new post's title by removing words like "the", "and" and "how". Intermediate WP 7.1 SEO PHP Send a Last-Modified Header on Posts and Pages Send each post's last modified date as an HTTP header, which crawlers and caches use to check for changes. Beginner WP 7.1 Block Editor PHP Turn Off the Block Directory Stop the block inserter suggesting and installing blocks from WordPress.org when a search finds nothing. Beginner WP 7.1 Block Editor PHP Remove the Openverse Tab From the Media Inserter Hide the Openverse library of free images from the block inserter's Media tab, so editors only use your own media. Beginner WP 7.1 Block Editor PHP Turn Off the Font Library Stop editors installing and uploading fonts through the Site Editor's font library, keeping your typography consistent. Beginner WP 7.1 Block Editor PHP Turn Off Fullscreen Mode in the Editor Open the block editor with the normal admin menu and toolbar visible, instead of WordPress's fullscreen mode. Beginner WP 7.1 Block Editor PHP Turn Off the Editor Welcome Guide Stop the "Welcome to the editor" pop-up appearing for new users and on new browsers. Beginner WP 7.1 Block Editor PHP Only Let Administrators Lock Blocks Remove the Lock option from the block toolbar for everyone except administrators, so editors can't lock or unlock blocks. Beginner WP 7.1 Block Editor PHP Hide the Code Editor From Non-Administrators Remove the "Code editor" option from the block editor for everyone except administrators. Beginner WP 7.1 Block Editor PHP Add a Custom Block Style Add your own style option, like "Brand outline" for buttons, to a core block's Styles panel. Beginner WP 7.1 Block Editor PHP Remove Built-In Block Styles Remove style options you don't want editors to use, such as the Rounded image style or the Plain quote style. Intermediate WP 7.1 Block Editor PHP Remove Embed Variations You Don’t Use Clean up the inserter by removing embed blocks for services you never use, such as Tumblr, Reddit or Crowdsignal. Intermediate WP 7.1 Block Editor PHP Start New Posts With Default Content Pre-fill new posts with blocks or text, such as an introduction prompt and a call-to-action, so every post starts with your structure. Beginner WP 7.1 Block Editor PHP Give a Post Type a Block Template Make every new entry of a post type start with a fixed set of blocks, and optionally stop editors adding or removing blocks. Intermediate WP 7.1 Block Editor PHP Limit Heading Levels in the Heading Block Only offer H2 to H4 in the Heading block, so editors can't add a second H1 or tiny H6 headings. Intermediate WP 7.1 Block Editor PHP Remove Custom Colours and Font Sizes Make editors choose from your theme's palette and font sizes only, by removing the custom colour picker and size input. Intermediate WP 7.1 Block Editor PHP Load Your Theme’s Styles in the Editor Make the block editor look like the front end in a classic theme, by loading an editor stylesheet. Beginner WP 7.1 Block Editor PHP Disable Gutenberg for Specific Post Types Selectively disable the block editor for specific custom post types while keeping it active everywhere else on your site. Beginner WP 7.1 Block Editor PHP Remove Default Block Patterns from the Inserter Remove WordPress's built-in block patterns and the patterns it downloads from WordPress.org, so the inserter only shows your own. Beginner WP 7.1 Block Editor PHP Limit Allowed Block Types by Post Type Restrict which blocks are available in the editor on a per-post-type basis, giving clients a focused, simplified editing experience. Intermediate WP 7.1 Block Editor PHP Register a Custom Block Pattern Category Add a custom category to the block pattern inserter so your site-specific patterns are grouped separately from core and plugin patterns. Beginner WP 7.1 Block Editor PHP Lock the Site Editor and Template Editing Hide the Site Editor and turn off template editing in the post editor, so clients can write content without changing headers, footers or templates. Intermediate WP 7.1 SEO PHP Add Organization and WebSite Schema to the Homepage Tell search engines your organisation's name, logo and social profiles, and which name to show for your site in results. Intermediate WP 7.1 SEO PHP Remove Users From the WordPress Sitemap Stop WordPress listing author archive URLs, and with them your usernames, in its built-in XML sitemap. Beginner WP 7.1 SEO PHP Remove Post Types and Taxonomies From the Sitemap Keep content types you don't want indexed, such as tags or a private custom post type, out of WordPress's XML sitemap. Beginner WP 7.1 SEO PHP Exclude Specific Posts From the Sitemap Leave individual posts or pages, such as a thank-you page or a landing page for ads, out of the WordPress sitemap. Beginner WP 7.1 SEO PHP Turn Off the Built-In WordPress Sitemap Disable /wp-sitemap.xml when another plugin provides your sitemap, so search engines only see one. Beginner WP 7.1 SEO PHP Add Last-Modified Dates to the Sitemap Add a lastmod date to every post and page in WordPress's sitemap, so search engines know what changed. Beginner WP 7.1 SEO PHP Add Meta Descriptions Without an SEO Plugin Print a meta description on every post and page from its excerpt, and on the homepage from your tagline. Beginner WP 7.1 SEO PHP Change the Page Title Separator and Format Change the dash between the page and site name in browser tabs and search results, and drop the tagline from the homepage title. Beginner WP 7.1 SEO PHP Add 301 Redirects Without a Plugin Redirect old URLs that now return 404 to their new pages with a simple list, without installing a redirection plugin. Intermediate WP 7.1 SEO PHP Noindex Specific Pages Add noindex to pages that shouldn't appear in search results, such as thank-you pages and members-only areas. Beginner WP 7.1 SEO PHP Mark Affiliate Links as Sponsored Automatically add rel="sponsored nofollow" to affiliate links in your posts, as Google asks, using WordPress's HTML API. Intermediate WP 7.1 SEO PHP Display Breadcrumbs Without a Plugin A template function that prints accessible breadcrumbs for posts, pages, archives, search and 404 pages. Intermediate WP 7.1 SEO PHP Add Featured Images to the RSS Feed Include each post's featured image at the top of its RSS feed item, so feed readers and email newsletters show it. Beginner WP 7.1 SEO PHP Add Breadcrumb Schema Markup Without a Plugin Output BreadcrumbList JSON-LD schema in your page head for singular posts, taxonomy archives, and custom post type archives to help Google display breadcrumbs in search results. Intermediate WP 7.1 SEO PHP Add Rules to the Virtual robots.txt Add your own rules to the robots.txt file WordPress generates, keep the defaults, and point crawlers to the right sitemap. Beginner WP 7.1 SEO PHP Add Canonical URL to Custom Post Type Archives Output a self-referencing canonical link tag on custom post type archive pages, which many SEO plugins omit by default. Intermediate WP 7.1 SEO PHP Add Article JSON-LD Schema to Blog Posts Output Article structured data in JSON-LD format on single blog posts, providing search engines with author, date, image, and publisher information that enables rich result eligibility. Intermediate WP 7.1 SEO PHP Add FAQ Schema From a Custom Field Define FAQ question and answer pairs in a custom field and output FAQPage JSON-LD schema automatically, enabling Google's FAQ rich results without a plugin. Intermediate WP 7.1 SEO PHP Noindex Date, Author and Thin Archive Pages Tell search engines not to index date archives, author archives on single-author sites and empty tag pages, using WordPress's robots API. Beginner WP 7.1 SEO PHP Ping IndexNow When You Publish Tell Bing, Yandex and other IndexNow search engines about new and updated posts the moment you publish, with a key file WordPress serves for you. Intermediate WP 7.1 SEO PHP Add Open Graph Tags Without a Plugin Add Open Graph and Twitter card tags to posts and pages so links share with the right title, description and image, and step aside when an SEO plugin is active. Intermediate WP 7.1 Theme & Front End CSS Stop Sticky Headers Covering Anchor Targets Leave space above headings when visitors jump to them, so a fixed or sticky header doesn't hide them. Beginner WP 7.1 Theme & Front End JS Add a “Back to Top” Button Show a round button in the bottom corner after visitors scroll down, which takes them back to the top of the page. Beginner WP 7.1 Theme & Front End JS Add Copy Buttons to Code Blocks Add a "Copy" button to every code block in your posts, so readers can copy code with one click. Intermediate WP 7.1 Theme & Front End JS Show a Reading Progress Bar Add a thin bar across the top of the screen that fills up as the reader scrolls through an article. Beginner WP 7.1 Theme & Front End JS Add a Class to the Header When the Page Scrolls Add an is-scrolled class to your header after the visitor scrolls, so you can shrink it or add a shadow with CSS. Beginner WP 7.1 Theme & Front End JS Add Link Anchors to Headings Give every heading in your posts an id and a small "#" link, so readers can share links to a specific section. Intermediate WP 7.1 Theme & Front End JS Open External Links in a New Tab Make links to other websites open in a new tab, with the safe rel attributes and a hidden notice for screen reader users. Beginner WP 7.1 Theme & Front End PHP Add Code to the Head and Footer Add verification tags, tracking scripts or chat widgets to every page, in the head or just before the closing body tag. Beginner WP 7.1 Theme & Front End PHP Remove “Category:” From Archive Titles Show "News" instead of "Category: News" at the top of category, tag and other archive pages. Beginner WP 7.1 Theme & Front End PHP Add a [year] Shortcode for Copyright Notices Add [year] and [copyright] shortcodes so your footer's copyright year updates itself every January. Beginner WP 7.1 Theme & Front End PHP Show a Dismissible Announcement Bar Show a slim message bar at the top of every page, such as a sale or shipping notice, that visitors can close. Intermediate WP 7.1 Theme & Front End PHP Show a “Last Updated” Date on Posts Add "Last updated on…" above posts that were changed at least a day after publishing. Beginner WP 7.1 Theme & Front End PHP Add Share Links Without Tracking Scripts Add plain share links for X, LinkedIn, Facebook and email below each post, with no third-party scripts or cookies. Intermediate WP 7.1 Theme & Front End PHP Add a Class to Menu Links Add your own CSS class to the links in a menu, such as a "nav-link" class your design system or framework expects. Beginner WP 7.1 Theme & Front End PHP Exclude a Category From the Blog Page Keep posts from one category, such as News or Podcast, off the main blog page while leaving them in their own archive. Beginner WP 7.1 Theme & Front End PHP Change the “Read More” Link Text Replace "(more…)" from the More block with your own text, including the post title for screen readers. Beginner WP 7.1 Theme & Front End PHP Change the Comment Form Title and Button Change "Leave a Reply", the "Post Comment" button and the notes above the comment form. Beginner WP 7.1 Theme & Front End PHP Register a New Widget Area Add a new sidebar or widget area to a classic theme, ready to fill from Appearance > Widgets. Beginner WP 7.1 Theme & Front End PHP Add Custom Body Classes by Page Template Append custom CSS classes to the body tag based on the current page template, post type, or taxonomy, enabling template-specific CSS targeting without inline styles. Beginner WP 7.1 Theme & Front End PHP Use Your Own Default Avatar Replace the generic mystery person Gravatar shown for users without a profile image with your own custom default avatar hosted on your site. Beginner WP 7.1 Theme & Front End PHP Register a Custom Navigation Menu Location Register one or more custom nav menu locations so they appear in Appearance > Menus and can be assigned and rendered anywhere in your theme templates. Beginner WP 7.1 Admin & Dashboard PHP Hide Screen Options From Non-Administrators Remove the Screen Options tab for editors and other roles, so they can't hide important columns and boxes by accident. Beginner WP 7.1 Admin & Dashboard PHP Filter the Posts List by Author Add an "All authors" dropdown next to the category filter on the Posts screen. Intermediate WP 7.1 Admin & Dashboard PHP Add Taxonomy Filters to Custom Post Type Lists Add a dropdown filter for each category-style taxonomy on custom post type list screens, like WordPress has for Posts. Intermediate WP 7.1 Admin & Dashboard PHP Show the Page Template in the Pages List Add a Template column to Pages, showing which page template each page uses. Beginner WP 7.1 Admin & Dashboard PHP Add a Word Count Column to Posts Show how many words each post has in the Posts list, to spot thin content quickly. Beginner WP 7.1 Admin & Dashboard PHP Add Quick Links to the Admin Bar Add a "Quick links" menu to the admin bar with shortcuts to screens you open often, like Permalinks and Site Health. Beginner WP 7.1 Admin & Dashboard PHP Show Scheduled Posts on the Dashboard Add a dashboard widget listing the next 10 scheduled posts, with their publish dates and edit links. Beginner WP 7.1 Admin & Dashboard PHP Stop Key Plugins Being Deactivated Remove the Deactivate and Delete links for plugins your site depends on, and quietly keep them active if someone tries anyway. Intermediate WP 7.1 Admin & Dashboard PHP Turn Off the Admin Email Confirmation Screen Stop WordPress asking administrators every six months to confirm the site's admin email address after they log in. Beginner WP 7.1 Admin & Dashboard PHP Warn Editors When They Edit the Homepage Show a warning at the top of the editor when someone opens the page set as your homepage. Beginner WP 7.1 Theme & Front End CSS Smooth Scrolling for Anchor Links One CSS rule for smooth jumps to page sections, which switches off for visitors who prefer reduced motion. Beginner WP 7.1 Theme & Front End CSS Brand-Coloured Text Selection Change the highlight colour when visitors select text, from the browser's default blue to your brand colour. Beginner WP 7.1 Theme & Front End CSS Make Video Embeds Responsive Make YouTube and Vimeo iframes scale to the width of their container and keep a 16:9 shape on every screen. Beginner WP 7.1 Theme & Front End CSS Hide the reCAPTCHA Badge the Allowed Way Hide Google's floating reCAPTCHA badge while keeping the required notice, so forms stay protected and within Google's terms. Beginner WP 7.1 Theme & Front End CSS Fluid Heading Sizes With clamp() Make headings scale smoothly between a minimum size on phones and a maximum on large screens, with no breakpoints. Beginner WP 7.1 Theme & Front End CSS Add a Basic Dark Mode Switch your site to dark colours automatically for visitors whose device is set to dark mode. Intermediate WP 7.1 Theme & Front End CSS Limit Excerpts to Three Lines Cut post card excerpts off after three lines with an ellipsis, so cards in a grid line up neatly. Beginner WP 7.1 Theme & Front End CSS Clean Print Styles for Posts Hide headers, menus and sidebars when a page is printed, and show link addresses after link text. Beginner WP 7.1 Theme & Front End CSS Mark External Links With an Icon Add a small arrow after links in your content that point to other websites, so readers know they're leaving. Beginner WP 7.1 Admin & Dashboard PHP Add a Custom Admin Dashboard Widget Add a branded welcome widget to the WordPress admin dashboard with quick links, site stats, or any custom content useful for your clients. Beginner WP 7.1 Admin & Dashboard PHP Add Custom Columns to the Posts List Table Add a featured image thumbnail and custom field value as sortable columns in the WordPress posts list table for faster content management. Intermediate WP 7.1 Admin & Dashboard PHP Set Custom Admin Footer Text Replace the default 'Thank you for creating with WordPress' footer text in the admin with your own branded message or support link. Beginner WP 7.1 Admin & Dashboard PHP Remove Unused Default Dashboard Widgets Remove the WordPress news feed, welcome panel, quick draft, and other default dashboard widgets to give clients and non-technical users a cleaner, less cluttered admin dashboard. Beginner WP 7.1 Admin & Dashboard PHP Change the Posts Per Page Count in Admin List Tables Override the number of posts shown per page in WordPress admin list tables on a per-post-type basis, without requiring each user to change their Screen Options. Beginner WP 7.1 Admin & Dashboard PHP Simple Maintenance Mode for Non-Admin Users Put your site into maintenance mode for all non-admin visitors by displaying a custom maintenance page, while keeping the admin area and logged-in administrator access fully functional. Intermediate WP 7.1 Admin & Dashboard PHP Add a “Duplicate” Link to Posts and Pages Copy any post or page, with its content, categories, tags and custom fields, into a new draft with one click. Intermediate WP 7.1 Admin & Dashboard PHP Show Post IDs in Admin Lists Add an ID column to the posts and pages lists, so you can find IDs for shortcodes and settings without hovering over links. Beginner WP 7.1 Admin & Dashboard PHP Add a Sortable “Last Modified” Column Show when each post and page was last updated, and sort the list by it to find stale content. Beginner WP 7.1 Admin & Dashboard PHP Hide Admin Notices From Non-Administrators Stop plugin promotions and setup reminders appearing for editors, shop managers and clients, while administrators still see everything. Intermediate WP 7.1 Admin & Dashboard PHP Remove “Howdy” From the Admin Bar Replace "Howdy, Name" in the top-right of the admin bar with just the user's name. Beginner WP 7.1 Admin & Dashboard PHP Remove the WordPress Logo From the Admin Bar Remove the WordPress logo menu and its links to WordPress.org from the top-left of the admin bar. Beginner WP 7.1 Admin & Dashboard PHP Set a Default Admin Colour Scheme for New Users Give every new user a chosen wp-admin colour scheme, such as Midnight or Modern, instead of the default. Beginner WP 7.1 Admin & Dashboard PHP Hide Admin Menu Items From Non-Administrators Remove menu items like Tools and Comments for editors and other roles, so clients only see what they use. Beginner WP 7.1 Admin & Dashboard PHP Reorder the Admin Menu Put the wp-admin menu items in the order your team uses most, such as Pages above Posts. Beginner WP 7.1 Admin & Dashboard PHP Add Your Own CSS to wp-admin Load a few lines of your own CSS on every admin page, to hide clutter or match your brand. Beginner WP 7.1 Admin & Dashboard PHP Show the Pending Posts Count in the Admin Menu Add a red bubble with the number of posts waiting for review next to Posts in the admin menu. Intermediate WP 7.1 Admin & Dashboard PHP Show the Environment in the Admin Bar Add a coloured STAGING or DEVELOPMENT badge to the admin bar, so nobody mistakes a test site for the live one. Beginner WP 7.1 Admin & Dashboard PHP Add a Site Notes Widget to the Dashboard Give your team a shared notes box on the dashboard for logins, reminders and handover notes, editable by administrators. Intermediate WP 7.1 Admin & Dashboard PHP Remove the Help Tabs in wp-admin Remove the "Help" tab and its panels from the top-right of admin screens. Beginner WP 7.1 Performance PHP Replace WP-Cron With a Real Cron Job Stop WordPress running scheduled tasks during page loads, and run them on a schedule from your server instead. Beginner WP 7.1 Performance PHP Raise the WordPress Memory Limit Give WordPress more PHP memory for the front end and wp-admin, to fix "Allowed memory size exhausted" errors. Beginner WP 7.1 Performance PHP Don’t Lazy-Load Images Above the Fold Tell WordPress how many images at the top of each page to load straight away instead of lazily, to speed up your hero image. Beginner WP 7.1 Performance PHP Tune or Turn Off Speculative Loading Make WordPress prerender pages as visitors hover over links for near-instant navigation, or turn speculative loading off. Intermediate WP 7.1 Performance PHP Stop a Large Option From Autoloading Turn off autoloading for big options that WordPress loads on every request but rarely needs. Intermediate WP 7.1 Performance PHP Load Block Styles Only for Blocks on the Page On classic themes, load each block's CSS only when that block is used, instead of one big stylesheet for every block. Beginner WP 7.1 Performance PHP Add Cache Headers for Logged-Out Visitors Let your CDN and browsers cache public pages for a few minutes, while keeping logged-in users, carts and checkout uncached. Intermediate WP 7.1 Performance PHP Delete Old Post Revisions Automatically Remove post revisions older than 90 days with a daily scheduled task, keeping the database lean without losing recent history. Intermediate WP 7.1 Performance PHP Empty the Trash Sooner Make WordPress permanently delete trashed posts, pages and comments after 7 days instead of 30. Beginner WP 7.1 Performance PHP Turn Off Site Search Return a 404 for WordPress search results on sites that don't use search, stopping bots from running expensive searches. Beginner WP 7.1 Performance PHP Remove the Recent Comments Widget’s Inline CSS Stop WordPress printing a block of inline CSS in the page head for the classic Recent Comments widget. Beginner WP 7.1 Performance PHP Load a Plugin’s Files Only on the Pages That Need Them Stop plugins like Contact Form 7 loading their CSS and JavaScript on every page when they're only used on one. Beginner WP 7.1 Performance PHP Log Page Loads Slower Than 2 Seconds Write a line to the PHP error log whenever WordPress takes more than 2 seconds to build a page, with the URL, query count and memory. Intermediate WP 7.1 Performance PHP Cache Expensive Queries in a Transient Store the result of a slow query, like a "most popular posts" list, for 12 hours and clear it automatically when posts change. Intermediate WP 7.1 Performance PHP Preload Your Main Web Font Tell the browser to download your main self-hosted font file early, so text appears in the right font sooner. Beginner WP 7.1 Performance PHP Change How Often the Editor Autosaves Make the post editor autosave every 2 minutes instead of every minute, to cut down on requests and revisions. Beginner WP 7.1 Performance PHP Stop Sending Pingbacks When You Publish Stop WordPress contacting every site you link to and pinging update services each time you publish, which speeds up publishing. Beginner WP 7.1 Performance PHP Cache Navigation Menus Store the HTML of large classic menus in the object cache, and clear it whenever a menu is saved. Intermediate WP 7.1 Performance PHP Stop Generating Preview Images for PDFs Stop WordPress turning the first page of every uploaded PDF into a set of preview images, which saves upload time and disk space. Beginner WP 7.1 Performance PHP Delete Old Spam Comments Automatically Permanently delete comments that have been marked as spam for more than 15 days, in daily batches. Intermediate WP 7.1 Performance PHP Control the Heartbeat API Safely Turn off the Heartbeat API for logged-out visitors and slow it down in wp-admin, without breaking autosave, post locking or login expiry warnings. Beginner WP 7.1 Performance PHP Disable the Emoji Script and Styles Remove the emoji detection script, inline styles and DNS prefetch WordPress adds to every page. Emojis still show using the visitor's own system font. Beginner WP 7.1 Security PHP Block Common Usernames Like “admin” Stop anyone registering or being created with usernames attackers try first, such as admin, administrator and root. Beginner WP 7.1 Security PHP Email an Alert When Someone Becomes an Administrator Get an email whenever a new administrator account is created or an existing user is promoted to administrator. Intermediate WP 7.1 Security PHP Email Administrators When They Log In From a New IP Send administrators an email when their account logs in from an IP address it hasn't used before. Intermediate WP 7.1 Security PHP Limit Uploads to Safe File Types Only allow the file types your site actually needs, such as images, PDFs and video, in the Media Library. Beginner WP 7.1 Security PHP Disable Author Archives Redirect author archive pages to the homepage and stop themes linking to them, which hides author usernames. Beginner WP 7.1 Security PHP Stop Registration Spam With a Honeypot Add a hidden field and a time check to the WordPress registration form, rejecting bots that fill it in or submit instantly. Intermediate WP 7.1 Security PHP Hide PHP Errors From Visitors Make sure PHP warnings and errors are never printed on your live site, where they can reveal file paths and plugin details. Beginner WP 7.1 Security PHP Force HTTPS for the Login Page and wp-admin Make WordPress always use HTTPS for logins and the dashboard, so passwords and cookies are never sent unencrypted. Beginner WP 7.1 Security PHP Stop Administrators Posting Unfiltered HTML Filter scripts and other risky HTML from posts by every user, including administrators, to limit the damage of a stolen account. Beginner WP 7.1 Security PHP Turn On Automatic Plugin Updates Install plugin updates automatically, so security fixes are applied within hours, with an option to update only the plugins you choose. Beginner WP 7.1 Security PHP Hide Author Details From oEmbed Responses Remove the author name and author archive URL WordPress includes when other sites embed your posts. Beginner WP 7.1 Security PHP Make Password Reset Links Expire Faster Make "reset your password" links expire after one hour instead of WordPress's default of one day. Beginner WP 7.1 Performance PHP Preload the Featured Image and Preconnect to Key Origins Preload each post's featured image so it appears sooner, and open early connections to the outside origins your pages really use. Intermediate WP 7.1 Performance PHP Defer or Async Scripts the WordPress Way Load chosen scripts with defer or async using WordPress's built-in loading strategy, which respects script dependencies. Intermediate WP 7.1 Performance PHP Remove RSS Feed Links from the Page Head Remove the auto-discovery RSS and Atom feed link tags that WordPress outputs in every page head, along with the comment feed links. Beginner WP 7.1 Performance PHP Clean Up wp_head. Remove Unnecessary Link Tags Remove the wlwmanifest link, shortlink, adjacent post links, REST API discovery link, and oEmbed discovery tags that WordPress adds to every page head by default. Beginner WP 7.1 Performance PHP Remove jQuery Migrate on the Frontend Dequeue the jQuery Migrate script on the frontend for sites whose themes and plugins are compatible with modern jQuery, removing an unnecessary dependency. Beginner WP 7.1 Performance PHP Disable oEmbed Completely Remove WordPress's oEmbed endpoint, front-end script, and discovery links to prevent your site from being embedded elsewhere and eliminate unnecessary oEmbed-related requests. Beginner WP 7.1 Performance PHP Remove Dashicons When the Admin Bar Is Hidden Stop WordPress from loading the Dashicons font stylesheet on the frontend for visitors who aren't logged in, since Dashicons is only needed for the admin bar. Beginner WP 7.1 Performance PHP Skip Block CSS on Pages Without Blocks On classic and page-builder themes, stop loading the block library stylesheet on pages that contain no blocks. Intermediate WP 7.1 WooCommerce PHP Allow Only One Product in the Cart Replace whatever is in the cart when a new product is added, for stores that sell one plan, ticket or service at a time. Intermediate WP 7.1 Requires WooCommerce WooCommerce PHP Change the “Added to Your Cart” Message Rewrite the notice shown after adding a product to the cart, and point its button to checkout instead of the cart. Beginner WP 7.1 Requires WooCommerce Security PHP Block XML-RPC Completely Turn off XML-RPC, hide the pingback header and refuse direct requests to xmlrpc.php, a favourite target for brute-force attacks. Beginner WP 7.1 Security PHP Hide WordPress Version Number Remove the WordPress version number from the page head, RSS feeds, and asset query strings to reduce information leakage to automated scanners. Beginner WP 7.1 Security PHP Disable the Theme and Plugin File Editor Remove the built-in code editors from wp-admin so a stolen admin login can't be used to edit PHP files on your server. Beginner WP 7.1 Security PHP Add HTTP Security Headers via WordPress Set X-Content-Type-Options, X-Frame-Options, Referrer-Policy, and Permissions-Policy response headers from WordPress to improve your site's security posture without touching server config. Intermediate WP 7.1 Security PHP Disable User Enumeration via REST API and Author Archives Block automated tools from harvesting your WordPress usernames through the REST API users endpoint and author archive URL redirect. Intermediate WP 7.1 Security PHP Add a Content Security Policy in Report-Only Mode Send a starter Content Security Policy that reports what it would block without breaking anything, so you can tighten it safely. Advanced WP 7.1 Security PHP Require Stronger Passwords Reject passwords shorter than 12 characters or containing the username when users set or reset their password. Intermediate WP 7.1 Security PHP Limit Login Attempts Lock out an IP address for 15 minutes after 5 failed logins, using transients, with no extra tables. Intermediate WP 7.1 Security PHP Show One Generic Login Error Replace "The password you entered for the username admin is incorrect" with one message that doesn't confirm whether a username exists. Beginner WP 7.1 Security PHP Disable Application Passwords Turn off application passwords, which let apps access your site through the REST API, if nothing on your site uses them. Beginner WP 7.1 Security PHP Hide Usernames in Comment and Body Classes Remove the CSS classes that reveal each author's login name in comments and on author archive pages. Beginner WP 7.1 Security PHP Shorten Login Sessions for Staff Log out editors and administrators after 8 hours, or 2 days with "Remember me", instead of WordPress's 2 and 14 days. Beginner WP 7.1 Security PHP Disable Pingbacks but Keep XML-RPC Remove the pingback methods attackers abuse for DDoS and port scanning, while keeping XML-RPC working for Jetpack and the mobile app. Beginner WP 7.1 Security PHP Add a security.txt File Publish a security.txt file at /.well-known/security.txt so researchers know how to report vulnerabilities to you. Beginner WP 7.1 Security PHP Keep Customers and Subscribers Out of wp-admin Redirect users who can't edit content away from wp-admin to My Account or the homepage, without breaking AJAX. Beginner WP 7.1 Security PHP Honeypot Spam Protection for the Comment Form Add a hidden honeypot field to the WordPress comment form that catches spam bots filling in all fields automatically, rejecting their submissions without CAPTCHA friction. Intermediate WP 7.1 Security PHP Redirect HTTP to HTTPS Safely Send every HTTP request to the HTTPS version using your site's own domain, not the request's Host header, and add an HSTS header. Intermediate WP 7.1 WooCommerce PHP Set a Minimum and Maximum Quantity Per Product Limit how many of each product a customer can buy, and require a minimum, with checks on the product page and in the cart. Intermediate WP 7.1 Requires WooCommerce WooCommerce PHP Send Shoppers Straight to Checkout After Adding to Cart Skip the cart page for stores with one product or simple orders: clicking Add to cart goes straight to checkout. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Show the Discount Percentage on Sale Badges Replace the plain "Sale!" badge with how much the customer saves, like "-25%", calculated from each product's prices. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Hide Product Counts in Category Titles Remove the "(12)" product count shown next to category names on the shop page. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Change How Many Products Show Per Page Set how many products appear on each shop and category page in classic themes. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Change the Number of Shop Columns Change how many products sit side by side on shop and category pages in classic themes. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Remove Related Products From Product Pages Remove the "Related products" section from single product pages. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Change the Number of Related Products Show more or fewer related products on product pages, and set how many columns they use. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Remove, Rename or Reorder Product Tabs Remove the Reviews or Additional information tab, rename Description, and change the order the tabs appear in. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Add a Custom Product Tab Add your own tab to every product page, such as Shipping & Returns, with content you write once. Intermediate WP 7.1 Requires WooCommerce WooCommerce PHP Hide the SKU, Categories and Tags on Product Pages Remove the "SKU: … Category: … Tags: …" line from single product pages, or hide only the SKU. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Custom Stock Messages (“Only 3 Left”) Replace WooCommerce's stock text with friendlier messages like "Only 3 left" and "Back soon". Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Add an “Empty Cart” Button Let shoppers clear their whole cart with one click on the cart page, protected by a security check. Intermediate WP 7.1 Requires WooCommerce WooCommerce PHP Show “Free” Instead of $0.00 Display the word "Free" for products priced at zero instead of showing $0.00. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Add a Handling Fee to Every Order Add a fixed handling fee, or a percentage of the cart, to every order. Works in the classic and block-based checkout. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Disable a Payment Method by Country or Cart Total Hide a payment method for certain countries or above a cart total, for example cash on delivery for large or overseas orders. Intermediate WP 7.1 Requires WooCommerce WooCommerce PHP Add Custom Text to WooCommerce Emails Add a message, such as next steps or a support link, to the emails customers get for processing and completed orders. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Remove or Rename My Account Menu Items Remove tabs like Downloads from the WooCommerce My Account menu and rename others. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Add a Custom Tab to My Account Add a new page to WooCommerce's My Account area, such as Support or Rewards, with its own menu item and URL. Advanced WP 7.1 Requires WooCommerce WooCommerce PHP Add a Prefix to Order Numbers Show order numbers like "NP-1234" instead of "1234" in emails, My Account and wp-admin. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Untick “Ship to a Different Address” by Default Start the classic checkout with "Ship to a different address?" unticked, so most customers only fill in one address. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Change the “Return to Shop” Link Send the "Return to shop" button on an empty cart to any page you choose, such as your homepage or a featured category. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Add a “Sold Out” Badge on the Shop Page Show a clear "Sold out" badge on out-of-stock products in the shop grid, so shoppers don't click through to find out. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Remove the Password Strength Meter on Checkout Stop loading WooCommerce's password strength meter on the front end, which removes a large script from checkout and My Account. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Add a Custom Order Status Add an order status such as "Awaiting shipment" to track orders between processing and completed. Intermediate WP 7.1 Requires WooCommerce WooCommerce PHP Change the “Place Order” Button Text Replace "Place order" on the classic checkout with your own wording, such as "Pay now" or "Complete purchase". Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Remove Fields From the Classic Checkout Remove the company name, second address line and other fields you don't need from the classic checkout form. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Make the Phone Field Optional at Checkout Stop requiring a phone number on the classic checkout, so customers who don't want to share it can still order. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Add a Custom Field to Checkout Ask customers an extra question at checkout, such as a gift message or how they heard about you, using WooCommerce's checkout fields API. Intermediate WP 7.1 Requires WooCommerce WooCommerce PHP Show “Add X More for Free Shipping” in the Cart Tell shoppers exactly how much more they need to spend to get free shipping, right in the cart and at checkout. Intermediate WP 7.1 Requires WooCommerce WooCommerce PHP Hide Other Shipping Rates When Free Shipping Is Available When a customer qualifies for free shipping, show only the free option instead of making them pick it from a list of paid ones. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Load WooCommerce Scripts Only on Shop Pages Stop WooCommerce loading its styles and cart scripts on blog posts and other pages that don't sell anything, without breaking order attribution. Intermediate WP 7.1 Requires WooCommerce WooCommerce PHP Change Add-to-Cart Button Text by Product Type Customise the WooCommerce add-to-cart button label for simple, variable, and external products without touching template files. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Auto-Complete Virtual and Downloadable Orders Automatically mark WooCommerce orders as Completed when they contain only virtual or downloadable products, eliminating the need to manually process these orders. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Disable the WooCommerce Default Stylesheet Prevent WooCommerce from loading its default frontend stylesheet when your theme provides its own complete WooCommerce styling. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Hide the Shop Page Title Hide the "Shop" heading and product category titles on WooCommerce archive pages, with optional lines to hide their descriptions too. Beginner WP 7.1 Requires WooCommerce WooCommerce PHP Hide Prices and Add-to-Cart for Non-Logged-In Users Replace product prices and add-to-cart buttons with a login prompt for unauthenticated visitors, a common pattern for B2B wholesale and membership-gated WooCommerce stores. Intermediate WP 7.1 Requires WooCommerce WooCommerce PHP Set a Minimum Order Amount Before Checkout Prevent customers from proceeding to checkout until their cart total meets a minimum order value, displaying a clear notice about how much more they need to add. Beginner WP 7.1 Requires WooCommerce

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only