Security snippets

Lock down logins, APIs and files with small, tested changes. Each one explains what it blocks and what it might affect.

Showing 29 snippets

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 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
Want it without code?Our plugins do the heavy lifting, with settings, updates and support.
Browse plugins
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 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 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 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 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 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 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

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