Plugin : Registered Users Only

Update: Please get the plugin from the wp-plugins.org repository. You can file bug reports there as well. It makes it a lot easier for me to manage the plugin’s development.

I was gonna call this plugin “Bouncer” but settled for a more explanatory name instead.

This plugin will allow only registered users of your blog to view the blog. If you have a wordpress powered blog that you don’t want your parents, or the secretary in your office, or the POTUS, to read it(okay, well, I can’t guarantee the last one :P), then View source and save or Download the .zip file to start using it. This will effectively password protect your wordpress blog, and also prevent search engines from indexing the pages in the blog.

Instructions :

  1. Save the file registered_only.php to your wp-content/plugins folder
  2. Activate the plugin from the plugin administration page
  3. Relax

Usage Notes:

  1. If you really want your defense against unscrupulous readers to be strong, then disable the “Anyone can register” option in Options->General in your WordPress administration interface.
  2. If you want google and other search engines to be able to index your blog pages, then comment(add two // in the beginning of) the line
    echo '<meta name="robots" content="noindex,follow" />'; . This, however, would mean that the search engines might index your pages and if you want a “private” blog, then this would not be suitable, which is why is it uncommented by default.
  3. If you are getting a “headers already sent” warning, then try adding the following one line to your .htaccess file (create a file called .htaccess if you don’t have one already) :
    PHP_FLAG output_buffering on

This plugin is basically the auth.php file that ships with WordPress 1.2, adapted to fit needs, and is distributed under the GPL license.

Other Articles on this Subject:

102 Responses to “Plugin : Registered Users Only”

  1. Ben
    July 5th, 2004 | 12:00 am

    I guess this explains why I couldn’t access your weblog earlier this evening! Thatnks for all your work on WordPress. I am in the process of moving from MT.

  2. July 5th, 2004 | 12:06 am

    I apologize for the inconvenience caused. I like to test things out live before releasing them out into the wild :)

    Thanks for stopping by.

  3. July 5th, 2004 | 4:16 am

    […] 2004 Registered users only Filed under: LinkyLoo — 2fargon @ 12:16 am Plugin to restrict wordpress blog viewership to registered users only.  […]

  4. July 5th, 2004 | 10:56 am

    Hi Carthik, wow! just what the doctor ordered. Now I can even get my wife to start a private blog :) Great stuff man. Keep ‘em coming.

  5. July 5th, 2004 | 5:14 pm

    […] plugin will password protect your entire blog so that only registered viewers can see it. Registered Users Only [via Weblog Tools Collection] Po […]

  6. Ria
    July 6th, 2004 | 1:29 am

    Thank you for coming up with this plugin. I was looking for something like this when I first moved to WordPress a few months ago.

  7. July 6th, 2004 | 1:38 am

    You’re welcome!

  8. July 6th, 2004 | 4:26 am

    An option for admin moderation after sign-up and before allowing the user to view or post would be nice for really private blogs. Possible?

  9. July 6th, 2004 | 10:28 am

    As it is, new users can view the posts. I suggest you take away the “Users can register themselves option” in the options interface, and then manually add users based on your needs. They could email you and then you could add them on. New users are created with level zero, and that gives them the privilege to read the blog, which is the minimum permission, taking that away would mean they are not a user, if you see what I mean :)

  10. July 6th, 2004 | 12:08 pm

    Hi there, thanks for the reply Carthik. Yeah, it kinda dawned on me later when I looked under Options.

    May be I’m trying to create a restricted access while not shooing away from by removing the Register link and asking them to email me.

    You see the problem with users is that they don’t like to be intimidated by asking the owner directly. They’d rather do it discreetly and so will the owner respond by allowing them (a kind of Yahoo! Groups concept if you know what I mean).

    The application, btw, is actually not for a blog, but rather to an info portal (that will contain localized copy protected info) and will be served across continents on my company’s intra.

    Thanks again. I can live with the current option, but, would still love to see that in feature (possibly). Cheers.

  11. Lane
    July 6th, 2004 | 1:59 pm

    For some reason I’m getting a “Cannot modify header information - header already sent…” error and I’ve gone through every php file and made sure about all the the whitespace. Is there maybe something else I should take a look at? This is on a fresh install of WP (1.2) (cleaned PHP files, etc). After going through a bunch of Googled pages, the only thing I came across was information about HTML elements coming before the redirect, but I’m not sure if thats it and/or how to modify this. Thanks.

    Ref URL: http://laneallen.com/journal/

  12. July 6th, 2004 | 4:24 pm

    I’m also getting this message. Any ideas?

  13. July 6th, 2004 | 4:26 pm

    Please check the plugin file if you had opened it for editing in any editor.

    The usual problems are a blank line after the closing ?>, a space somewhere in the middle of <?php or ?>

    My best guess is you might have opened it for editing in the the cpanel editing tool or some such web based text editor.

    The Template editor tool in wordpress is really good, please use that to check this file for the spaces I mentioned.

    To start with you could re-upload the .php plugin file in the zip download I have provided (instead of using the .phps saved and edited)

    let me know if the problem still remains

  14. July 9th, 2004 | 8:25 am

    I encountered the same problem as above, but when I attempted to fix it by making sure no spaces were present, I encountered another problem where only the plugin was being sent for display not the rest of the weblog (though the header problem was fixed).

  15. July 10th, 2004 | 1:20 am

    ooh
    i like the sound of this
    i guess i must try it out…and read the comments too..

  16. July 12th, 2004 | 5:50 am

    Im having the same header problem too. and i used the template editor tool and i found a black line after ?> in the .php pulgin from your zip which i straight uploaded it.

    I deleted the blank line but the problem is still there. any other helps available?

    btw, whats “a space somewhere in the middle of < ?php or ?>” mean?

  17. Tim
    July 12th, 2004 | 4:38 pm

    I’ve tried several times to install this plugin (including installing an “unopened” version). All I get is:

    Warning: Cannot modify header information - headers already sent by (output started at /home/.gam/symserv/symtym.com/wp/index.php:17) in /home/.gam/symserv/symtym.com/wp/wp-content/plugins/registered_only.php on line 63

    Warning: Cannot modify header information - headers already sent by (output started at /home/.gam/symserv/symtym.com/wp/index.php:17) in /home/.gam/symserv/symtym.com/wp/wp-content/plugins/registered_only.php on line 64

    Warning: Cannot modify header information - headers already sent by (output started at /home/.gam/symserv/symtym.com/wp/index.php:17) in /home/.gam/symserv/symtym.com/wp/wp-content/plugins/registered_only.php on line 65

    Warning: Cannot modify header information - headers already sent by (output started at /home/.gam/symserv/symtym.com/wp/index.php:17) in /home/.gam/symserv/symtym.com/wp/wp-content/plugins/registered_only.php on line 66

    Warning: Cannot modify header information - headers already sent by (output started at /home/.gam/symserv/symtym.com/wp/index.php:17) in /home/.gam/symserv/symtym.com/wp/wp-content/plugins/registered_only.php on line 72

    I thought perhaps it was a CHMOD problem with registered_only.php with a CHMOD at 644, but changing it to 777 made no difference. Would like to try this out–because this is exactly the level of control I’m looking for. What am I doing wrong?

  18. July 12th, 2004 | 6:19 pm

    Could it be that you are using other plugins simultaneaously? Try turning the others off and activating this one to see if you still have a problem.
    The headers already sent problem usually occurs when there is a white space somewhere. Other than these, there is nothing I can think of.

  19. Tim
    July 12th, 2004 | 7:17 pm

    No other plugins running. I’m stumped. I reinstalled the index.php and changed back to the original wp-layout.css, and no change. For the plugin it says version 0.1. Is this the correct version number?

  20. July 21st, 2004 | 10:07 pm

    I’ve encountered the same error. I’ve looked for whitespace, turned off the “users register themselves” option, turned off all my plugins and tried and it still throws the header error.

    I’m curious. Have you tested it with your website on a different browser? Reason I’m asking is because in my main browswer “firefox” I was still able to view my website, however, in IE, it was throwing the header error. Obviously the cookie was allowing me to see my website on firefox.

    Just wondering if you view your website in a different browser, or anyone else who has this plugin working. Do you encounter this error?

  21. Kate
    July 23rd, 2004 | 12:45 pm

    Wow! This plug-in is GREAT! Easy & quick! Thank you! It’s exactly what I needed!

  22. Ria
    July 27th, 2004 | 12:14 am

    Hi Carthik, I installed WP 1.2 on one of my other domain’s. I uploaded the Registered Users plugin and activated it. I received the same header warning that some of the others (in the above comments) received. This is from a clean install of WP 1.2. The header warnings indicated that the headers were already sent by line 9 of index.php and that they were in conflict with lines 63-66, 72.

    I took the liberty of looking at index.php that came with WP 1.2 and I noticed the following in between the <head> </head> :

    <?php wp_head(); ?>

    It was located right above the </head> tag. When I removed this line, the header warning disappeared from my site. It seems that this line was causing the problem. I don’t know how important it was to have that line in WP, but hopefully you can figure out why it was causing the error.

    I hope this helps.

  23. Ria
    July 27th, 2004 | 12:19 am

    I just noticed that once I removed <?php wp_head(); ?> from my index.php, I was able to view the posts on my site - even when I was logged out. So I’m guessing that portion of code is needed.

  24. July 27th, 2004 | 6:28 am

    wp_head is the hook that is used to activate or use the plugin, and that is required. Could it be possible that there are other plugins that you using that is causing the headers sent problem?

  25. July 27th, 2004 | 6:29 am

    There must be something specific to your installation that is causing the problems. I am so sorry, it should have worked fine, like it has for so many others. I am stumped.

  26. Ria
    July 27th, 2004 | 7:47 pm

    There are no other plugins activated on this installation of WP 1.2. I will try it again on another install.

  27. July 28th, 2004 | 4:12 pm

    Carthik, sorry I haven’t gotten back to you. I’ve been busy with offline life. I pulled the line < ?php wp_head();?> out like Ria mentioned and the error is gone. However, < ?php wp_head();?> is needed inside the head tags if you use the Show/Hide on same page plugin for the comments.

  28. July 28th, 2004 | 4:33 pm

    Like I said before, this plugin will not work without that line. Deleting that line is equivalent to turning off the plugin. I do not have access to a server which throws this error, yet. It works fine on 4 servers I have tried, and so, though I would love to get to the root of this, I am unable to.

  29. Ria
    July 29th, 2004 | 2:23 am

    I could give you access to the blog that I am setting up. Just e-mail me to let me know if you want to do that. Do you actually need access to the cpanel? Or will FTP and WP 1.2 login suffice?

  30. July 29th, 2004 | 11:22 pm

    Excellent! Works wonderfully now. Thank you!

  31. July 31st, 2004 | 8:16 am

    Like I said before too

  32. Soo
    August 3rd, 2004 | 9:57 pm

    I managed to resolve the “headers already sent” problen by adding a .htaccess file with a line “PHP_FLAG output_buffering on” as instructed by Carthik. This file is at the blog’s root directory (e.g. http://mydomain.com/myblog/.htaccess). It works only for LINUX and Apache. Unfornately it does not work for WinNT and IIS. Anyone with suggestions on how to resolve this for WinNT and IIS?

  33. Cloud
    August 4th, 2004 | 6:57 am

    wow! itz working now. finally…..thanks all.

  34. sasha
    August 18th, 2004 | 3:14 am

    is it compatible with blogspot?

  35. andrew
    August 20th, 2004 | 1:38 pm

    Wow - does absolutely nothing ;-) I’m curious as to why it wouldn’t be working at all on any level. My blog setup is in different directories (index.php on root level & wordpress in a renamed dir one level deeper).

  36. August 20th, 2004 | 1:50 pm

    I am not sure if wordpress has a problem with plugins on index.php getting enabled when the index is in a different directory. There is nothing in the plugin itself that depends on the location of index.php

  37. Tsan-Kuang Lee
    September 10th, 2004 | 2:47 am

    I also got this header problem. .htaccess way doesn’t work since my server’s apache doesn’t support “PHP_FLAG output_buffering on”. After so many frustrating trying, I gave up and chose to hack the core a little bit. Basically wrap all HTML output before header is completely sent with ob_start() and ob_end_flush(). Here’s the modification I made to index.php: (looked for ADDED by TK)

    < ?php
    /* Don't remove this line. */
    require('./wp-blog-header.php');
    // ADDED by TK
    ob_start();
    // Ended ADDED by TK
    ?>
    < !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    @import url( < ?php echo get_settings(\'siteurl\'); ?>/wp-layout.css );

    Tsan-Kuang Lee
    September 10th, 2004 | 2:49 am

    sorry about that… here it is again

    < ?php
    /* Don't remove this line. */
    require('./wp-blog-header.php');
    // ADDED by TK
    ob_start();
    // Ended ADDED by TK
    ?>
    < !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    @import url( < ?php echo get_settings(\'siteurl\'); ?>/wp-layout.css );

    Tsan-Kuang Lee
    September 10th, 2004 | 2:50 am

    ah…. all right… in index.php, after line 2: require(’./wp-blog-header.php’); add this
    ob_start();

    before closing < / head >, add
    ob_end_flush();

  38. Jim
    September 23rd, 2004 | 8:08 pm

    Any new developments with the header errors problem? I’ve tried most or all of the solutions offered, but no dice. I don’t understand posts 22-24; where exactly should those lines be put in?

  39. Nick
    September 29th, 2004 | 3:06 am

    Jim,

    I followed the comments from post 24, and it has worked for me.

    < ?php
    /* Don't remove this line. */
    require('./wp-blog-header.php');
    ob_start();
    ?>

    ob_end_flush();

  40. Nick
    September 29th, 2004 | 5:38 am

    Actually, I don’t know where to place “ob_end_flush();” but it seems to be working without this

  41. October 5th, 2004 | 11:58 am

    Thank you very much - it was extremely helpful in making a private blog. Just teh right thing!

  42. October 6th, 2004 | 4:30 am

    […] ers Plugin Filed under: Site Related — Tina @ 9:29 pm When I try to install this plugin, I get errors before I even activate it. Is it because I am […]

  43. October 6th, 2004 | 2:39 pm

    I have been trying to install this plugin, but I am having an error.

    Fatal error: Cannot redeclare verify_login() (previously declared in
    /home/tinaj/public_html/wp-includes/functions-user.php:3) in
    /home/tinaj/public_html/wp-content/plugins/registered_only.php on line 29

    If I add to the .htaccess file I get a 500 internal error. So I have removed the plugin from my directory. I don’t know what I can do to fix this. Could it be because I am using WP 1.3-alpha-2?

    Thank you!

  44. October 6th, 2004 | 2:49 pm

    Tina, yes, it appears that 1.3-a-2 also has a function called verify_login(), which is there in the plugin. You can get it to work by renaming all occurences of verify_login() in the plugin file, with some other function name, like RO_verify_login()

    Coming to think of it, I think it is time I rewrote the plugin, since the verify_login functions seems to be in the core, as a seperate function now.

    Thank you for the heads-up!

  45. October 6th, 2004 | 3:00 pm

    Thank you!!! I will try that.

  46. Sam
    October 23rd, 2004 | 1:47 pm

    This is a fantastic plugin, Carthik, once I finally got it to work. Much more satisfying than the .htaccess option.

    I was wondering, though, since everyone needs to be logged in to view the blog now, might it be possible to automatically fill in their user information when commenting on posts?

  47. Panda
    November 5th, 2004 | 7:59 am

    Has anyone got the definitive workaround for the header error ?
    .htacess doesnt work for me
    after editing index.php with ob_start() the error goes but the blog is not secure ?

  48. November 18th, 2004 | 1:04 am

    I edited this plugin and got rid of the header stuff that was causing a problem. It’s working in 1.3, I think, but I’d like some feedback about my changes. If anybody sees this, drop me an email.

  49. don
    December 10th, 2004 | 1:03 am

    looks like this for me:

    Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/fixit/www/news/index.php:9) in /home/httpd/fixit/www/news/wp-content/plugins/registered_only.php on line 63

    Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/fixit/www/news/index.php:9) in /home/httpd/fixit/www/news/wp-content/plugins/registered_only.php on line 64

    Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/fixit/www/news/index.php:9) in /home/httpd/fixit/www/news/wp-content/plugins/registered_only.php on line 65

    Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/fixit/www/news/index.php:9) in /home/httpd/fixit/www/news/wp-content/plugins/registered_only.php on line 66

    Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/fixit/www/news/index.php:9) in /home/httpd/fixit/www/news/wp-content/plugins/registered_only.php on line 72

  50. don
    December 10th, 2004 | 1:40 am

    I might add, this is the latest stable version of WP, it works great without activation. As soon as I activate, then I get the error (when not logged in). There are no other plug-ins activated. Something is not quite right.

  51. don
    December 10th, 2004 | 1:50 am

    ok with a bit more work …
    I put this:
    ob_start(); at the start of the first php coding about line two.
    and I went all the way to the bottom of the index.php file and added at the bottom the following:
    >php?
    ob_end_flush();
    ?<

    It is the last thing in the index.php file now … and it appears to work.
    We’ll see if it takes this post. Post 24ish was the key, but I couldn’t quite figure out where to put this. I’ll now have to research a bit to figure out what the effect of this action is, but it appears to make this all work. I might add, that I used a plain text editor and have no trailing lines anywhere, so that wasn’t the problem.

  52. don
    December 10th, 2004 | 1:52 am

    opps …
    <php?
    ob_end_flush();
    ?>

    sorry for any confusion.

    Site administator please truncate all of these posts, delete most of the first one and just give my solution if you will be so kind.

  53. January 31st, 2005 | 8:08 pm

    When i activate this plugin in version 1.2.2, It doesn’t appear to work. any suggestions?

  54. February 1st, 2005 | 9:33 am

    Fimion,

    There is a new version I checked into the plugin repository. The URL is http://dev.wp-plugins.org/browser/registered-only/ . Please check that out and see if that works for you. You can file any bug report there at the repository, by opening a ticket. It is easier for me to keep track of it over ther.

    Thank you.

  55. February 5th, 2005 | 2:51 am

    i really like your plugin i fact i’m using it on my private blog..I have a few questions to ask you..Is there any way I could approve or disappove registeration before they would be able to view my blog?Any plugins available that would help me achieve this?Would it be difficult to create one myself(I have php skills)

    Thanks in advance

  56. February 5th, 2005 | 12:06 pm

    Myisha,

    Could you please follow up on the plugin at the repository ticket system? That will help me keep track of all the issues in one place.

    As for a solution, I will have to modify the plugin to allow only users with level 1 (or 2) or something to view the posts. Then you can “promote” those new registered viewers that you want to allow to view the posts.

  57. February 15th, 2005 | 5:14 pm

    This plugin needs to be updated for WordPress 1.5

  58. February 19th, 2005 | 10:05 pm

    Yes, I agree. I would very much like to see this plugin working with 1.5 I tried the latest CVS version (0.4) and it still didn’t work. I love this plugin.

  59. February 20th, 2005 | 9:55 am

    […] Gallery is now protected » Registered user plugin for the blog Carthiku2019s20Blog20BB20Blog20Archive20BB20Plugin203A20Registered20Users20Onl […]

  60. sascha
    February 25th, 2005 | 4:04 pm

    Hi Carthik, have you got any plans to update the Plugin to 1.5?

  61. February 25th, 2005 | 8:12 pm

    I will upgrade it this weekend, hopefully, Sascha.

  62. candy
    February 27th, 2005 | 1:36 am

    can it be used to password protect a blogspot blog?

    some unknown person has been coming to my blog and tagging me, leaving very rude and defaming comments about me.

    im reluctant to shift my blog to another provider thus i surfed upon this website and found this..

  63. February 27th, 2005 | 2:33 pm

    Candy,

    I am sorry, but no, this is useful only for wordpress blogs.

  64. Matt
    February 28th, 2005 | 9:20 pm

    I am also awaiting an update for this awesome plugin to work with WP 1.5.

    Many thanks :)

    -Matt

  65. March 5th, 2005 | 2:23 am

    Perhaps this should be updated to reference the plugin repository?

  66. March 5th, 2005 | 11:24 am

    Thanks for the reminder Matt. I’ve done it.

  67. March 16th, 2005 | 12:13 am

    Hey Carthik, has this been updated yet? Just wanted to say I was hoping you’d get this working for 1.5, too. :)

  68. Scott
    March 30th, 2005 | 2:47 pm

    Would you send the updated plugin to my email when you are done?
    thanks

  69. March 30th, 2005 | 6:33 pm

    Sure thing, Scott.

  70. April 3rd, 2005 | 10:25 am

    Great plugin…but to echo the above sentiments, is there a 1.5-compatible ver yet? You have some anxiously awaiting fans…

  71. Dave
    April 3rd, 2005 | 7:57 pm

    I haven’t seen this plugin in action, but I found it when I was looking for a way to restrict access to my entire site (does it?). I could also use the .htaccess method or a php login script, but since I’m in the progress of implementing WP as the main access point for my site, I suppose (like I said, haven’t seen it in action yet) this would be the cleanest solution.
    So, umm, what marshall said.. ;-)

  72. April 5th, 2005 | 4:06 am

    I have a patch that makes this work with WordPress 1.5, I’m not a PHP coder so it would need to be adjusted as it assumes the directory is /blogs/ (needs this to exclude the login URI)
    It’s at http://dev.wp-plugins.org/ticket/134

  73. April 5th, 2005 | 4:39 am

    Thank you, David. I appreciate your help :)
    I wanted to update the plugin to use some of the new functions that do the work in the core, in 1.5
    I should get down to it sometime…life interferes.

  74. Scott
    April 6th, 2005 | 3:15 pm

    when i ran that patch i got the following message

    patching file registered_only.php
    Hunk #1 succeeded at 26 with fuzz 2.
    Hunk #2 FAILED at 57.
    1 out of 2 hunks FAILED — saving rejects to file registered_only.php.rej

    does that still mean it worked?

  75. April 6th, 2005 | 3:30 pm

    Update:

    I have uploaded the patched file to
    http://carthik.net/wpplugins/registered_only_patched.phps

    Please try it out, Scott.

  76. Michael G.
    April 6th, 2005 | 5:07 pm

    That worked! Thanks! First time using WP and this plugin. I created a “level 1″ user and upon login it takes you to the admin profile page rather than the actual blog page…any idea what needs to be tweaked? I raised the level to 5 and got the full admin page…which is ok for a full admin…but not otherwise. Suggestion on where to start tweaking?

    Thanks!

    Michael G.

  77. April 6th, 2005 | 6:01 pm

    That is the default WP behaviour, and even without the plugin, a user who logs in would be taken to those pages you mention.

    A level 5 user will have less privileges than a level 10 admin user, and level 1 user will have even less privileges.

  78. Dave
    April 7th, 2005 | 12:34 am

    Thanks for the patch guys. I had a few hick-ups, which I thought I’d mention here, so perhaps someone else might benefit.

    First, I got the infamous header errors after plugin activation. Turns out, that was caused because the line ‘//Comment this line if you want your blog to be indexed by search engines’ in the page had wrapped and // only works if the comment is on the same line. It wasn’t in my case, since it had wrapped. Correcting this solved the header problem for me.

    The only other thing was changing the ‘blogs’ ‘if ($_SERVER[’PHP_SELF’] != ‘/blogs/wp-login.php’)’ into wordpress, since that is the name of the folder I keep it in (might be obvious, but there you go).

    After that it all worked and I could see the plugin in action. I really like it. The only 2 things I noticed that I don’t really like, are the fact that in MSIE the login area aligns to the left (in Firefox no probs but most of my users still have MSIE) and that once logged in, you are taken to your profile and not to the blog main page. Now before you go, ‘Yeah, but..’. I know, those 2 gripes have nothing to do with this plugin, they are default WP behaviour. Nonetheless, I thought I’d mention that, since this plugin highlights those issues and you might get people that think it’s the plugin.

    I’m definitely going to use this plugin for my site (Thanks Carthik, Ryan and David) and I’ll try and get rid of the last 2 issues somehow. I’m sure it’s either not that difficult or someone has already figured it out.

  79. Dave
    April 9th, 2005 | 11:24 pm

    Hmm, did a bit more testing, but it seems that the login div in wp_login.php does center properly in wordpress, but after having activated the registered only plugin the login div suddenly aligns to the left. Does anyone have any idea why and how to get it centered? I assume it’s some MSIE & CSS bug as usual, but have no clear idea of what it is.

    I haven’t gotten closer to configuring wp to go to the main page either. The only thing I can come up with is putting a hard link to /wp_admin/ (to be able to get to the profile area) in the sidebar and deleting the reference to /wp-admin/profile.php on line 178 of login.php. Then, if you login you always go to the blog root. I suppose it works, but it’s hardcoding and clunky at that. Does anyone have a more elegant solution?

    While I’m at it - this kinda relates - I posted this question in the wordpress.org forum (how to & troubeshooting, title is: Wp_register & wp_loginout don’t change?, in which I responded to someone with a similar problem), if you’re a Level 0 user the Register and Login links don’t change to Site Admin (which should really be ‘Profile’ for all but the admin but that’s another question) and Logoff. However, they don’t and remain Register and Login. I need to keep the level at 0, but do want to see those links change.
    Btw, when you’re logged in as a level 0 user and click on Login, it takes you to the profile page, which, if you’ve deleted the reference on line 178 as indicated above, changes to doing nothing. Big story, but I thought I’d add as many details as I could.

    Could anyone help me out with the above 3 questions? Help would be very much appreciated.

  80. David
    April 20th, 2005 | 5:09 am

    After a bit of digging and experimenting I discovered that the following line is what was causing the misalignment problems in MSIE.

    echo ”;

    The alignment problem was also present in the particular theme I am using. If I remove the “robots” line then all is well.

    What are the ramifications of not having this line present and having a password protected blog?

  81. David
    April 20th, 2005 | 5:12 am

    My previous post seems to not display properly. The problem causing line is (with the comment characters):
    //echo ”; //Comment this line if you want your blog to be indexed by search engines

  82. DavidM
    April 20th, 2005 | 5:16 am

    More display problems… the alignment problems are caused by the line regarding robots and search engines.

  83. April 20th, 2005 | 6:40 am

    I tried using this plugin.

    so to answer dave.

    I got the same problem with CSS. at first, it entirely screwed up my sidebar. I then inserted some code to spell things out more explicitly, (previously, i was just counting on the default settings provided in the css already). And it fixed it in firefox. I opened up in IE. only to see an entire mess. Not only was my blog aligned to the left. but many other settings as well. I COULD look through my CSS again. but that’s a long job. And i’m just curious as to why the plugin would affect it in the first place.

    $redir = ‘Location: ‘ . get_settings(’siteurl’) . ‘/wp-login.php?redirect_to=

    this line in the plugin is affecting what it redirects to after logging in. urlencode($_SERVER[’REQUEST_URI’]);

  84. April 20th, 2005 | 7:05 am

    The robots.txt line is in place so that your blog entries do not get crawled by google, or other search engines. You can do without it, as the robot would not know the password to view the pages as well, I guess.

  85. michelle
    April 26th, 2005 | 4:13 pm

    i am trying to password protect a WP blog that is on a subdomain. i followed the directions and activated the plugin, and there are no errors, but there is nothing happening either. i can still go to the site and see everything without being prompted…

    i’d rather use this plugin if i can get it to work, .htaccess seems so much more complicated :( anyone have any tips?

    thanks in advance,
    michelle

  86. May 12th, 2005 | 3:00 pm

    […] the Registered Only plugin. The new version works on WordPress version 1.5.1 and 1.5. The older version had some issues. The new version is much lighter, and uses a […]

  87. May 12th, 2005 | 3:02 pm

    A new version of this plugin is now available. Please try it out and report on your findings.

    Thanks everyone for using the plugin and being such great users!

  88. Dave
    May 16th, 2005 | 11:08 pm

    I’ve tested the new plugin and it no longer aligns to the left in MSIE but nicely stays in the middle. Well done :-)

    The other issues I mentioned in my post of April 9th, 2005 at 11:24 pm are still there, but then again they probably should be addressed through a fix to Wordpress rather than your plugin.

    Thanks for the emailed update, very handy since I don’t check that often.

  89. febwa1976
    September 28th, 2005 | 6:25 pm

    I have started using the plugin and it works really well - jus what I was looking for - thanks.

    Question is I cannot find

    ‘echo ”; so how do I know I have stopped the search engines.

    Thanks

  90. September 29th, 2005 | 10:05 pm

    […] Have tried last night at home to use this plugin available from Carthik Sharma, no luck. I tried at the DreamHost blog just fearing that I may crash this stable one at Site5. […]

  91. September 30th, 2005 | 2:49 am

    […] It was that one by Carthik Sharma that didn’t seem to work.    For the site a few said it was piece of cake some reported the same problem I encountered. […]

  92. October 4th, 2005 | 5:25 am

    Would you consider writing a plugin just for me at a nominal sum? I can’t make your plugin to work but I think I need something slightly different from what you have described here. I am hoping to have a plugin which doesn’t stop people from viewing the blog. Instead when I compose each post I want a “tick box” to select if I want that particular post to be viewable by registered users only. A further step would be a combo selection to allow which level of registered users to view.

    Under Manage>Posts and Pages, there should also be a column showing what posts/pages have been ticked for registered users (and level) only such that I could uncheck some if I want to.

    My php skill isn’t good enough to do this and I desperately want to have one for my blog at a hosted site (not that at wp.com) presumbly one has to fiddle auth.php file and admin.php such that the feature can be displayed.

    Generally visitors to my blog will see the post titles and a note saying that only level ? registered users are allowed to view this post etc…. Of course an option should also be given on the header or sidebar for users to login right away without the hassle of logging in midway.

  93. October 4th, 2005 | 12:20 pm

    sfong, sorry for the delayed reply. I cannot write the plugin for you now since I am caught up with school and work at school. I am so sorry I can’t :( Hope you understand.

  94. Bfj
    November 23rd, 2005 | 8:43 am

    I just installed the plugin for the password protection, but nothing is changed, after the plugin is activated, I can still enter the page without entering any password (also after deleting the cookies on my computer)… The version of wordpress that I use is 1.5.2
    I hope that you can help me :-)

  95. November 28th, 2005 | 4:21 pm

    sfong -

    Have you checked out Category Levels: http://www.coppit.org/code/ (look at the link at the bottom of the page). This does most of what you are asking for.

  96. Amarand
    November 29th, 2005 | 1:03 pm

    First off, thanks for this great and useful plugin! Of course, I personally have always believed that this security feature should be integrated into any good blogging system (the ability to say “no one can see unless authenticated”)…but I digress.

    I’m using WP 1.5.2, and when I try to go to the site it gives me a grey screen, which serves the purpose of not allowing an unauthenticated user access wonderfully! When I authenticate, things start to work again.

    My question is this: is there a way to generate an automatic redirect to the login page for an unauthenticated user?

    Thanks again!!

  97. Xochi
    December 8th, 2005 | 9:52 pm

    I also have not been able to get this to work. The site won’t even load. With both Safari and Firefox the message says something about too many redirects or problem with blocked cookies. On Firefox I erased all cookies and still no luck. Any ideas?

  98. Xochi
    December 8th, 2005 | 9:58 pm

    Addendum to the above post. This is the address that is in the browser when it is trying to locate the site:

    http://(my_blogsite)/wp-login.php?redirect_to=%2Fwp-login.php%3Fredirect_to%3D%252Fwp-login.php%253Fredirect_to%253D%25252Fwp-login.php%25253Fredirect_to%25253D%2525252Fwp-login.php%2525253Fredirect_to%2525253D%252525252Fwp-login.php%252525253Fredirect_to%252525253D%25252525252Fwp-login.php%25252525253Fredirect_to%25252525253D%2525252525252Fwp-login.php%2525252525253Fredirect_to%2525252525253D%252525252525252Fwp-login.php%252525252525253Fredirect_to%252525252525253D%25252525252525252Fwp-login.php%25252525252525253Fredirect_to%25252525252525253D%2525252525252525252Fwp-login.php%2525252525252525253Fredirect_to%2525252525252525253D%252525252525252525252Fwp-login.php%252525252525252525253Fredirect_to%252525252525252525253D%25252525252525252525252Fwp-login.php%25252525252525252525253Fredirect_to%25252525252525252525253D%2525252525252525252525252Fwp-login.php%2525252525252525252525253Fredirect_to%2525252525252525252525253D%252525252525252525252525252Fwp-login.php%252525252525252525252525253Fredirect_to%252525252525252525252525253D%25252525252525252525252525252Fwp-login.php%25252525252525252525252525253Fredirect_to%25252525252525252525252525253D%2525252525252525252525252525252F

    (my_blogsite) is a valid address, I just am not listing it publicly.

  99. March 13th, 2006 | 6:02 pm

    […] WordPress You can use several options here. On top of all those mentioned above, WordPress already come with a password protect feature which protects individual posts. But if you find the built in feature too simplistic for you, you can also use plugins like Registered Users Only (which password protects the whole blog). There are also plugins such as Post Levels that only allow access to registered users of a certain permission level. Technorati Tags: internet technology wordpress […]

  100. Nadia
    April 26th, 2006 | 8:19 am

    Hy,

    Is there somebody to tell me where I can found plugin like Registered Users Only (which password protects the whole blog)for Wordpress 2.

Leave a reply