You could hook intop pre_comment_on_post
:
add_action( 'pre_comment_on_post', function(){
if ( empty ( $_SERVER['HTTP_REFERER'] ) )
exit;
});
But … be aware, not all requests without an referer are actually spam posts. Some firewalls and proxies strip this field. And most automated spam comes with a Referer
field filled with the name of the spammed domain. So you will get many false positives.
Related Posts:
- Create rewriterules for different domains in htaccess file with WP multisite
- Canonical Resource URLs Across a Multisite Network 2012?
- WordPress Multisite and how to apply sef urls only to specific sites
- Multisite htaccess with domain rewrites
- How to use WordPress Multisite With Different Domain Names?
- Site Redirecting to wp-signup.php
- Domain mapping (without plugin) in 4.5.x multisite?
- Multisite Domain Mapping with SSL
- multisite 404 error for subdirectory
- How to use alias domain for multisite installation?
- Multisite htaccess on localhost with WP as an SVN external?
- WordPress Multisite with multiple domains using Nginx
- WP-Admin not working properly at WordPress multisite with subdirectories
- What methods should be used to fend off splogs in a multiuser install? [closed]
- WordPress Multisite – Multiple subfolders for blogs
- Multisite wordpress and subdomain URL collisions
- “Preview Changes” button doesn’t show changes for previously published posts/pages
- Error 101 after upgrading WordPress
- Basically the opposite MultiSite URL question that most people ask
- Suppress subdirectory from WordPress Multisite primary URL
- How to add new sites and map a custom domain in WordPress Multisite?
- WordPress multisite with different domain
- 500 error when using virtual host
- Trying to migrate a WordPress Multisite with Domain Mapping
- Multiple blogs, different domain names, one install to rule them all
- Why wordpress multisite redirect to wp-signup if site exists?
- How do I use different domain for subdomains in WP Multisite?
- subdomain mulitsite on localhost in a subfolder
- WordPress Network for regional company websites
- How to do Domain Mapping to Subdirectories?
- Members area with externally-managed htaccess / htpasswd authentication?
- Multiple domains with different child themes on one installation?
- Dissolve Multisite while making site #5 the main site?
- WP MU – Accessing ‘Domain-Mapped’ WP-Admin with a subdomain
- WordPress multisite in subdirectory, not root, and remove base folder from url
- Install a Network under a mapped domain
- Issue with htaccess redirection in WP Multisite
- Multisite installation not in root – how to make live?
- Multisite setup help – plain domain/subsite always redirects to domain with subdir multisite
- Add additional non-rewrite .htaccess directives on multisites via mod_rewrite_rules filter
- Temp URL Redirect Loop
- WordPress MU Domain Mapping Just Redirects to Main Site
- Error uploading files bigger than 58 MB
- Wrong Redirect/Rewrite Rules?
- Htaccess file isn’t redirecting http sub-pages to https––they display 404 error instead, tried many solutions and none work
- Some PDF files get Forbidden Access and other open normally on the same directory subsites
- URL without www redirect directly with submission page – Multiwordpress install
- Link structure, WordPress IIS
- Multisite Subdirectory with same domain subdomain
- Multisite – Parent site with Polylang with different domains for each language [closed]
- Viewing / Editing A Multisite website after domain has expired
- WordPress Multisite + Erros with URLS and ADMIN
- Redirect old uploads after moving to multisite
- WordPress sub-domain multisite 505 error
- How to protect specific uploaded files from being accessed by non-logged-in users in WP-multisite
- URL for images folder on Multisite
- MU/Subdomains + Domain Mapping + SSL?
- Multisite install w/ Sub domains on a subdomain
- network site domain mapping still applied after being removed
- Multisite Subdomain Redirect Mask
- Help with multisite redirect issues using Cherokee OR solid nginx config?
- How to set up wordpress domain mapping on MAMP Pro
- Cannot use Network Admin (Dashboard) on Multi-site after 301 www redirect
- How do I correctly configure my AMPPS localhost to use subdomains for multisite?
- WordPress Multisite with subdomains on different domains
- Check if current site ID and value exist in WPDB
- Domain Mapping subsites of an Add-on Mulsite Domain
- 404 not working on main site on multisite
- Change WordPress Multisite Domain
- multisite 404 subfolder same name slug as site
- Rewriting request to another site
- Getting file errors in a WordPress Multisite ADMIN
- How to make the redirects right? IP to domain name folders
- WP Multi Site – configure Sub domain pointing to parent sub directory
- WordPress Multisite – Domain Mapping
- Can I add a rewrite rule in htaccess to remove the multisite subdirectory from the URL?
- trying to install a wordpress multisite in a subfolder and have custom subsite urls
- SSL for Mapped Domains with WordPress Multisite on AWS
- Events Calendar Multisite 404 for events
- Multisite domain mapping with SSL redirects to main domain
- WordPress Multi site Map Domains
- new WPMS site not working / Q setting up new site/subdomain
- Multisite issue
- Optimal setup for Multi Domain WordPress with Woocommerce
- Can’t access 2nd site (sub) dashboard of WordPress Multisite
- How to implement this subdirectory mapping in multisite?
- Multisite /files/ URLs broken after server move
- Domain mapping breaks some plugin scripts and css
- How to configure WordPress for multiple blogs without using multisite?
- Subdirectory and domain multisite installation
- WP Multisite .htaccess interferes with cgi-bin
- Multisite: Run a subdomain install from a directory install
- WordPress Domain Mapping shows new domain in place but takes me to the sub domain
- No input file specified after enabling multi site
- How can I set up a completely separate (not multisite) WordPress installation as a subdirectory of an existing WordPress blog?
- MU Domain mapping
- Redirect WordPress MS to no-www version, excepting some dirs and prefixes
- Best Way to Setup a Network of WP Sites?
- Multisite website configure Domain issue
- External rewrite rules missing in htaccess – Multisite