I’ve made a WordPress Plugin. I’ve found the Meta widget too big, as I wanted to reduce my sidebar’s length – and I think noone uses anything but the register / login links there, and even those ain’t used very often. So I thought hey, how about a widget which only contains those two? So here’s to you, my first widget: Simple Login. I suppose there’s tons of these out there, but it was a good start for me.
Drop me a comment or a pingback if you’re using it; also any feedback’s welcome (though I don’t know if there’s anything to talk about this pluginette…)
Oh, and disclaimer:
This software comes without any warranty, express or otherwise. Noone makes you to use it, so don’t try to blame me if it does wrong to your blog. (However, a description of the bug might help…)
Get the plugin through the wordpress plugin install dashboard, or here: simple_login
UPDATES:
2011.05.20.
Version 1.2 adds redirect options after a successful login. 1.2.1 is the same, trying to figure versioning out.
2009.06. 06.
Version 1.1 fixes an extra li bug I was told by David and Erlend.
2009. 05. 02.
The plugin was added to the WP repository, you can check it out here:






May 2nd, 2009 
June 24th, 2009 at 8:40 pm
Nice plugin. Thank you! Only one change I would make. An empty >> is made at the top of the widget. Code should be changed to following to eliminate. Thanks.
echo $before_title . $title . $after_title;
echo ” \n “;
wp_register();
echo “\n “;
wp_loginout();
echo “\n \n”;
echo $after_widget;
June 25th, 2009 at 8:14 am
Actually the empty >> doesn’t appear for me (as you can see). Are you sure it isn’t your theme that adds the extra artifacts?
Also, I used the UL because widget contents are usually in an unordered list so they appear as the others.
Thanks for the feedback though! :)
July 6th, 2009 at 10:01 am
The extra li-element appears, and it can be removed by using this, a modification of David’s solution:
echo $before_title . $title . $after_title;
echo ” \n “;
wp_register();
echo ” \n “;
wp_loginout();
echo “\n \n”;
echo $after_widget;
July 6th, 2009 at 10:20 am
You wrote exactly what he did, actually. I see the problem now, the wp_register() function also includes an extra li element – but if you strip all, the widget won’t work at all anymore.
July 15th, 2009 at 1:34 pm
Hello, and thanks for the plugin – It’s just what I needed, simple and reliable.
What I’d like is to be able to change the “Login” and “Register” link it creates on de sidebar to my own language (portuguese). Is there any way I can do this? If so, what file?
Thank you
Nuno Picado
(naturpt.nunopicado.com)
July 15th, 2009 at 1:54 pm
Actually those links are created by the wp_register() and the wp_loginout() calls, so anything that changes language for the blog engine (and the built-in meta widget) would have to change these too. Try this link: http://codex.wordpress.org/WordPress_in_Your_Language
July 15th, 2009 at 3:09 pm
Thank you very much Edem, it worked like a charm!
July 28th, 2009 at 5:43 pm
[...] Simple Login Widget – If you are using WordPress as a CMS, this simple widget will show just the login/logout and register links instead of all the RSS and Meta Feed crap. [...]
July 29th, 2009 at 6:54 am
My blog is http://www.tololoche.com/blog and the plugin instaled succesfuly, the only problem is it does not say Register, only Login.
Can you please help me, thanks.
July 29th, 2009 at 8:07 am
Have you set the “Anyone can register” on the dashboard / Settings / General page?
July 29th, 2009 at 10:32 pm
Dam, me feel like BIG NOOB.
:P
That was it, did not remeber to put thant on settings, sorry for that. This is what i get for no taking time to relax and do things 1 step at a itme.
July 30th, 2009 at 12:06 am
It’s okay, I’m glad it’s solved.
August 9th, 2009 at 10:29 pm
I have a problem. When i click on “login”, it basically reloads the home page and does not give me the login screen. I don’t know if it is due to the plugin or not. Also, i am unable to get admin login screen using the URL , http://www.hasya.com/wp-admin.
Any ideas? how to fix this?
August 10th, 2009 at 3:17 am
Does the login on the default Meta tab work? I doubt this is because of the plugin, it’s more like your wordpress install is corrupted somehow.
September 4th, 2009 at 3:09 am
Hi
Very nice plugin. Works great. Only one question: How can I change it so that when you click “Logout” it takes you back to the home page of the site? The site I’m using it on is made up of all static pages, no blog pages, so I would like it to pull up the home page when the “logout” link is clicked. Using WordPress mainly as a CMS and it works great!
Thanks!
September 8th, 2009 at 5:29 am
Unfortunately, that function is not part of this plugin; I wanted to keep it simple. Since 2.8 you can pass a redirect url to the wp_loginout() function, but that will redirect on both login and logout; or you can write an own login-logout function that redirects on logout but not at login. On second thought, that would make a nice plugin, I’ll see if I can find some time to write it (but it might already exist in the plugin repository).
September 11th, 2009 at 11:06 pm
Great plugin for my members to login BIG thanks..
Is it also possible to conf the plugin to accept login on email address as well as the user name?
Thanks
for any help and advice
September 12th, 2009 at 12:38 am
As I said, the widget uses the wp_loginout() and wp_register() functions. If you can set your wordpress to accept the email address globally, this plugin should work that way too. No warranty on that though.
March 19th, 2010 at 3:27 pm
Great plug-in…
Just one thing… my WP is set to Spanish but the plug-in is not translating the whole thing. It still shows “Welcome” and “Options” in English but the links are in Spanish…
Is this a bug?
March 19th, 2010 at 4:00 pm
“Welcome” and “Options”? This widget shouldn’t contain any of those. Also, it uses the API calls for the links, so I suspect it might be a translation based bug. Can you throw me a link to edem at thinkedem.hu so I can check it?
March 19th, 2010 at 8:20 pm
I just realize that the translation fails when adding the code to the template but it works fine when used as a widget… better look into it.
The website is on my nickname.
Cheers
March 19th, 2010 at 9:06 pm
Yes, it is intended to be used as a widget. It seems working now.
April 6th, 2010 at 7:08 pm
Hi, I have activated the plugin and the widget, checked the option “anyone can register”, but it only shows the login option.. is there anything I have forgotten? Thanks!
April 7th, 2010 at 7:57 pm
I guess you’ve Saved the changes. Does the original Meta widget work as it should, or is that “broken” as well?
June 10th, 2010 at 12:11 am
I suggest the following small change, in order to avoid displaying an empty Title. In some themes that looks ugly.
@28
<> if(!empty($title)) {
echo $before_title . $title . $after_title;
}
June 10th, 2010 at 12:20 am
Good idea, I’ll try to look into it some time this week.
June 26th, 2010 at 9:29 am
Is there a way to code this into my theme instead of using the widget?
November 18th, 2011 at 6:12 pm
Hey, thanks for the wonderful “little” PlugIn.
There’s one wish, after Login the user see “Admin” (witch is the user-dashboard) and “Anmelden” (german for LogIn). Is it possible to change the “admin” in “profile” fpr example?
I didn’t found a way in the php.
Thanks for your trouble.
Regards
Uwe
November 18th, 2011 at 6:25 pm
Hi, thanks for the positive feedback.
Actually that “Admin” is taken from the language localisation, so you would need to change the system-wide german language file. (I try to keep the plugin as simple as possible.)
November 18th, 2011 at 6:29 pm
Hi, since the plugin has some configurations, and I try to make it simple, I never tried to make it available via a function call. If you’re okay with static configuration, you could try to copy the code from the widget’s widget_simple_login function, should be simple enough. Or feel free to make a version with an options page configuration and a function call.
January 5th, 2012 at 12:14 am
Hey, great plug-in, was exactly what I was looking for. Only one hitch: I need clients to be able to log in and be redirected to their own private page. I’ve tried using [variable]username[/variable] in the custom redirect field, but it apparently can’t read variables…? Suggestions?
January 5th, 2012 at 12:25 am
No, this plugin doesn’t handle variables. The selected page is handed to wp_loginout without any parsing. These predefined options were satisfying for my own needs, implementing custom variables is possible, but was too time consuming at the time. :) If you’d like to implement it, you need to parse
$option['redirectto']and set$redirectaccordingly, in thewidget_simple_loginfunction. (Look for the switch at around line 26.)January 31st, 2012 at 1:26 pm
Thanks for the plug-in. Heaps better than Meta. Can you tell me if I can erase the “Site Admin” link that is displayed after logging in? I want one level of user to not access the dashboard but still access private content on the frontend.
Cheers
January 31st, 2012 at 4:03 pm
Deleting the link wouldn’t stop them being able to access the dashboard, though if they are not site admins, there’s only a few things they can do there. (Create a Subscriber test account and login to see what can they access.) Currently you can’t remove the site admin link, but I might add the option if I find the time (which is not likely for a while unfortunately).
February 1st, 2012 at 10:17 am
Hi Edem
Is it difficult to add a link into the widget when logged in?
I would like to have a link to a specific page that only displays in the widget when the profile is logged in.
Can this be done?
Cheers
Thanks for all your help.
February 5th, 2012 at 9:20 pm
I guess it wouldn’t be too difficult, but it kind of goes against the goal of the widget, that is being as simple as possible. Actually I don’t even check for the user being logged in, because the called functions printing the links do that already. But you could always use a plugin which hides pages from guest visitors, that also hides their links – I’m using WordPress Access Control for that.