Protector can hide pieces of a post, forcing the user to “do something” to see them.

To ask for help or send comments to Protector, please use this page.

Why to use it

You can have a premium content and want to make it available to new newsletter subscriber. So you can hide the most attractive part of this content and in place of it show a newsletter subscription form.

You can have some adult images in a post: you can ask te user to confirm his age before show up the gallery of nudes.

You want to spread a link blocking attractive content and asking the visitor to send the link to friends to unlock the content for him.

You can… there are many other cases, surely each of you can find out one.


Protector is available on WordPress Plugin directory: get Protector here.


Install the plugin as usual, the go to the configuration page and set a key. Can be anything, but no special simbols or spaces. Limit to numbers and letters.

Write a message in the message box, just for try. An example can be:

*** CENSORED ***

Choose a post to protect and insert this two tags around the post part to be hidden (without spaces between brackets and inner word “protect”).

[ protect ]
Content to be protected
[ /protect ]

Now open the post in your browser: you have to see the message instead of the real content. Now reload the page adding in the URL the piece:

?pk=(your key)

The post will show up complete (do not add parenthesis). Nice, isn’t it? (see examples below for real usage)

If there are other post with hidden parts, after the first unlocking with a key, all the other posts will be unlocked by a cookie keeping the key.

Configuration notes

Protector works only with permalink active. If your blog has post URL like

do not use this plugin.

The message area can include PHP code that will be executes on show time. To add PHP code simple enclose it with standard PHP tags: <?php … ?>.

If you need more messages to create different protection there are alternative message you can configure. To recall such messages it’s enough to specify the number when using the “protect” tag, as in the example below:

[ protect message=”2″ ]
Content to be protected
[ /protect ]

The redirect option in advanced configuration section force the plugin to send back a redirect after the key has been verified. This greatly helps to stop the indexing (and even the access) of the unprotected page. When a redirect is sent back, a fake parameter (xyz) is added to bypass the browser cache.


Now we can go with a more useful examples. You really have adult contents and want the user to make an action to confirm his age.

Wrap all those contents with “protect” tag as seen above and then write in the message box:

WARNING ADULT CONTENT. <a rel=”nofollow” href=”{url}?pk={key}”>Click here</a> only if you are 18+ otherwise go elsewhere.

As you see there are two placeholders: “url” will be replaced with the current page url and “key” with protector key. If you want you can use the tag {unprotected_url} which will be replaced with the current page URL with the key already added. The message becomes:

WARNING ADULT CONTENT. <a rel=”nofollow” href=”{unprotected_url}”>Click here</a> only if you are 18+ otherwise go elsewhere.

Newsletter integration

I’m working to integrate Protector with Newsletter plugin. The aim is to give users a personal key and not a global one. This key will be shared between Newsletter and Protector, so can be embedded in emails sent out andrecognized by protector directly.

Protector cannot…

Protector cannot stop search engines to index the link with the key. But it is enough smart to force a meta tag “noindex” when someone access a blog page with the Protector key in the URL.

Google respects it, not all engines or bots do.

Still, Protector cannot block users to diffuse links with the key: if you need a site with real user control, move towards a CMS with real authetication (and loose users who are tired to register to on more site…).


I wrote Protector on best of my knoweldge: if it does not work, if it does not protect as you except, it’s on you. Do not claim with me. But, of couse, I’m open to bugs reporting and suggestions.

My excuses for my bad english but it's the only way I have to communicate with you. Would you suggest a correction? Leave a comment, thank you!

Leave a Reply