PHP Snippets: WordPress Security Hardening (10)
About this product
Ten copy-paste snippets that close common WordPress attack surface — XML-RPC, version leaks, brute force, spam and REST user listing.
Features
- XML-RPC fully disabled, RSD/wlwmanifest links removed, X-Pingback header gone
- Login throttling per IP (5 attempts / 15 min, both filterable) via transients
- Comment honeypot, author-enumeration block, and logged-out REST user lockout
- Baseline security headers + file-permission watchdog with admin warning
- Each snippet standalone, documented, and harmless to the block editor
Install
- Back up your site (files + database).
- Paste the snippets you want into your child theme’s functions.php (05 goes in wp-config.php).
- Log out and verify: ?author=1 redirects home, /wp-json/wp/v2/users returns 401, xmlrpc.php reports disabled.
Requirements
WordPress 5.6+, PHP 7.4+. FTP/SSH access for wp-config.php edit and permission fixes.




Customer reviews
No reviews yet — be the first to review this product.
Buy this product to write a review
Only verified buyers can review — that keeps every review honest.
Buy now
Review rules:
Only customers who purchased this product can review it. One review per customer — you can edit yours anytime. New and edited reviews appear after approval. We never publish fake reviews.
Similar products
See more →
CODE PHP Snippets: WooCommerce Tweaks (10)
10 WooCommerce snippets: thank-you message, stock bar, auto-coupon links, free-shipping bar, min order, gift wrap and more.
$15.00
View →
CODE Regex Patterns Pack (25)
25 regex patterns with plain-English docs: email, URL, phone, UUID, semver, card shape, postal codes and more.
$15.00
View →
CODE SQL Snippets for WordPress (12)
12 commented WordPress SQL recipes: safe URL migration, spam purge, orphan hunts, transient cleanup, audits and more.
$15.00
View →
CODE PHP Contact Form Handler (complete)
Secure PHP contact-form processor: CSRF, honeypot, validation, safe mail() headers, JSON + redirect modes, sample form.
$15.00
View →
CODE PHP Snippets: Blog Boost (10)
10 copy-paste PHP functions for WordPress blogs: reading time, related posts, TOC, share links, breadcrumbs and more.
$15.00
View →