• Protect Content 1.0

    "ProtectContent" is an extremely simple Wordpress plugin that allows blog owners to separate content from users who are logged in and those whom aren't. By simply wrapping protected content in and tags it will be hidden to users not logged in and visible to those that are.

    ProtectContent Is No Longer Available

    Due to similarities to a similar wordpress plugin, ProtectContent is not available for download at this time.

    Instructions

    1. Place in wp-content/plugins directory.
    2. Activate.
    3. Wrap content to be hidden with and

Sponsored Links

27 Comments Add Your Own Comment

(September 8th, 2006 at 7:54 pm )


Hey there Alan,

I love this plugin its so simple and it works! However, How do I get the restriction message ie., “This page is for members only,… it’s free” to only display on those pages restricted. Currently, its on all of my pages. Thanks so much

(October 20th, 2006 at 3:40 am )


this does not work for me. maybe coz of cookies? if i have been logged in pst an entry that i want protected, then log out, will a someone who uses the same computer still be able to view the protected content?

(October 20th, 2006 at 9:50 am )


Hi people. I am working on updating the plugin. Work should be done and ready for downloading later today (20/10/2006) …

(October 20th, 2006 at 1:52 pm )


hello, i managed to get it to work and everything is going well except for one important bug… if you search for the a term contained in the tags, they will show up in the search excerpt of this plugin http://fucoder.com/code/search-excerpt/

what if someone searches their name, they’ll see the surrounding words.

a way to fix this? thanks!

(November 28th, 2006 at 2:55 am )


How does this plugin affect feeds? I would like for users reading the feed to be able to see that there is a protected post but not what the content is. There could also be a link to the post with the protected content, so that logged-in users could view it.

(December 7th, 2006 at 2:37 am )


Is there any chance of adding a feature that allows you to add a messege if the user’s not logged on?

(January 4th, 2007 at 1:24 pm )


Is it possible to display a note to the user where there is protected content and they are not logged in? (i.e. “Users must be logged in the see the following content.” Thanks.

(January 4th, 2007 at 2:40 pm )


Is there a way to display a message to users when there is protected content so that they know to login? Thanks.

(January 7th, 2007 at 7:13 pm )


This plugin is great, but it really needs “This page is for members only,… it’s free� message. Does anybody know how to add that? Thanks.

(January 8th, 2007 at 7:40 pm )


Hi Alan,
how can i show a message like “You have to log in to see protectet content!” in a protectet post?

(January 12th, 2007 at 11:22 pm )


hi

plugin seems to be right thing for me, however im not sure yet.
CAn you configure it so that i’ll hide content (links for example) from unregistered users, but they will see smth like “for members only” istead of the link in the post?

thanks.
~Dmtyro

(January 16th, 2007 at 4:47 am )


It is not working for me !! I have wordpress 2.0.5, Plugin was activated properly, I placed the protect content tag as mentioned in start and
end of content. but still does not work.Please help !!!

(February 5th, 2007 at 3:15 pm )


Thank you for this great Plugin

(February 10th, 2007 at 4:59 pm )


hey allen can you also make it so it TELLS people that they need to register/login to view the content?

(March 24th, 2007 at 2:20 pm )


Hi Alan!
I tested your hide-plugin a few minutes ago - and it works. But how can i hide a complete “page” (not the complete blog) with his subpages? The page should only shown to loged-in, registrated users.
Can your plugin realize that, too?

(April 9th, 2007 at 3:58 am )


function protect_content($content) {
global $current_user, $user_ID;

if (($current_user->id == 0) && ($user_ID == 0)){

$content = preg_replace(’(.*?)‘,”,$content);

}
return $content;
}

And you need correct the problems with the_excerpt and the feeds.

(May 14th, 2007 at 9:36 pm )


is there a way to hide content outside of the loop? Say a menu item that is in the header? sidebar?, etc.

(May 29th, 2007 at 7:12 pm )


If you want a message telling people to login, just change to code in the protectcontent.php file

Where it says:

return $pre.$suff;

Change it to:

return $pre. ‘Please login to see content!’ . $suf;

(May 29th, 2007 at 7:16 pm )


If you want a message telling people to login to view the content, just change the code in the protectcontent.php file

Where it says:

return $pre.$suf;

Change it to:

return $pre. ‘Please login to see content!’ . $suf;

(October 20th, 2008 at 12:00 pm )


Hi,
My Name is, Mark
great posts on here
my site:

http://p8lAdSfOS.spaces.live.com/

Add Your Own Comment Fields marked * are required.