By default, Blackhole Pro takes care of adding the required Blackhole trigger link to all web pages generated by your WordPress-powered site. But what if you only want to include the trigger link on a specific post or page? This tutorial explains how to do easily.
Why is this useful
The manual trigger link gives you control over where it’s included. By default, Blackhole adds the hidden trigger link to ALL of your WordPress-generated web pages. That works fine in most cases, but you may want to include the trigger only on a specific post or page. Maybe create a nice “trap” page or something. The manual-trigger technique lets you do it.
How to add the manual trigger
To implement the manual trigger, follow these steps:
- In the Blackhole settings, enable the option “Disable Trigger”, save changes.
- Choose post or page (or create a new one), and add
[blackhole_trigger]
anywhere, save changes.
That’s all there is to it. It’s a two-step plan. You can verify proper setup by examining the source code of your web pages. After following the above two steps, the trigger link should be displayed only on the posts/pages where you added it manually.
Customizing the manual trigger
By default, the hidden trigger link looks like this in the source code of your pages:
<a rel="nofollow" style="display:none;" href="https://example.com/?blackhole=1234567890" title="Do NOT follow this link or you will be banned from the site!">Name of Your Website</a>
If you’re letting Blackhole add it automatically, you can customize the trigger link in the plugin settings. Or if you are adding the trigger manually, you can customize the markup directly. So instead of adding [blackhole_trigger]
to your page, add the following code:
<a rel="nofollow" style="display:none;" href="https://example.com/?blackhole=[blackhole_nonce]" title="Do NOT follow this link or you will be banned from the site!">Name of Your Website</a>
You can change any part of that except for [blackhole_nonce]
. That shortcode outputs the dynamic nonce value, which WordPress uses to help secure requests, form submissions, and so forth. The nonce value in the trigger URL helps to prevent abuse, and is required in order for the plugin to work properly.
Also: remember to replace https://example.com/
with the URL of your WordPress installation. Once you’ve got that, save changes and you’re all set. The blackhole trigger will be included in the source code of the posts/pages to which you’ve added the code. You can verify this by examining the source code of your web page(s).
?blackhole
, make sure it matches in the plugin setting, “Custom Keyword”. Also remember to update your robots.txt rules, as explained in the Help tab infos on the plugin settings page.