Ready to get started?Download WordPress

Plugin Directory

Login With Ajax

Add smooth ajax login/registration effects and choose where users get redirected upon log in/out. Supports SSL, MultiSite, and BuddyPress.


Upgrading from v3 to v3.1

Due to the improvmenets necessary (specifically allowing multiple LWA widgets on one page), it was important to modify the template files to use classnames instead of ids.

If you have customized your widgets as per the instructions below, you will need make some modifications to your templates, and probably re-evaluate whether you still need custom JS if you went that far.

We've tried to minimize potential conflicts arising from this, but you should consider revising your template regarding these two points:

  • LoginWithAjax is now a static class, so things like $this->function() and $this->variable should become LoginWithAjax::function() and LoginWithAjax::$variable
  • Element IDs are now classnames, and are converted like so (we do have backwards compatibility to account for this, but still recommended):
    • LoginWithAjax becomes lwa
    • classname is all lowercase
    • underscores become hyphens
    • Example : LoginWithAjax_Form > lwa-form

Shortcodes & Template Tags

You can use the shortcode [login-with-ajax] or [lwa] and template tag login_with_ajax() with these options :

  • profile_link - (1 or 0)
    • If value is 1 (default), a profile link to wp-admin appears.
  • registration - (1 or 0)
    • If value is 1 (default), a registration link appears, providing you have registration enabled in your WP settings.
  • template - (template name/directory)
    • If this template directory exists, this template will be used. Default is 'default' template.
  • remember - (1 or 0)
    • If value is 1 (default), a remember password link appears for password recovery

SSL Logins

To force SSL, see http://codex.wordpress.org/Administration_Over_SSL. The plugin will automatically detect the wordpress settings.

Customizing the Widget

You can customize the html widgets in an upgrade-safe manner. Firstly, you need to understand how Login With Ajax loads templates:

  • When looking for files/templates there is an order of precedence - active child theme (if applicable), active parent themes, and finally the plugin folder
  • Login With Ajax loads only one CSS and JS file. The plugin checks the locations above and loads the one it finds first. This was done to minimize the number of resources loaded, but means that if you have more than one template, you should add any extra CSS and JS to those single files.
    • login-with-ajax.js and login-with-ajax.css must be located in either:
    • wp-content/themes/yourtheme/plugins/login-with-ajax/
    • wp-content/plugins/login-with-ajax/widget/
  • Login With Ajax then checks for template folders, if two folders match names (e.g. you move default template to your theme) the order of precedence explained above applies.
    • These theme folders are located within :
    • wp-content/themes/your-theme-or-child-theme/plugins/login-with-ajax/
    • wp-content/plugins/login-with-ajax/widget/
  • When a user is logged out, the widget_out.php will be shown, otherwise widget_in.php. These are located in the template folder.

For example, if you wanted to change some text on the default theme, you could simply copy wp-content/plugins/login-with-ajax/widget/default to wp-content/themes/yourtheme/plugins/login-with-ajax/default and then just edit the files as needed.

If you need to change the JS or CSS, copy the javascript file over to wp-content/themes/yourtheme/plugins/login-with-ajax/ (not within the template file) and edit accordingly.

The Javascript ajax magic relies on the class names within the template files, if you want to modify the templates, make sure you keep these class names.

Requires: 3.1 or higher
Compatible up to: 3.5.2
Last Updated: 2013-5-20
Downloads: 273,809


4 stars
4.4 out of 5 stars


0 of 14 support threads in the last two months have been resolved.

Got something to say? Need help?


Not enough data

0 people say it works.
0 people say it's broken.

100,1,1 100,1,1
100,1,1 100,2,2 100,1,1 100,1,1
0,1,0 100,1,1 0,1,0 100,1,1 0,1,0
86,7,6 0,1,0 100,1,1 0,1,0 100,1,1 0,1,0
100,2,2 67,3,2 100,7,7 100,7,7 100,1,1 100,2,2 67,3,2 0,1,0
88,8,7 83,6,5 50,2,1 100,4,4
80,10,8 100,1,1 100,1,1 100,5,5
75,4,3 100,3,3
0,1,0 100,1,1
82,11,9 100,2,2
80,10,8 33,3,1 50,2,1 100,6,6