WordPress plugin intelligence profile

Redirect to login if not logged in

Redirects users to the login page if the visitor is not logged in.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 5.0
Current version1.7.0
WordPress coverageTested up to WordPress 5.0
Minimum stackWP 3.0.1 · PHP —
Directory statusactive
Last directory update13 Sept 20188y ago
Active installations200Adoption metric — not a quality score
WordPress.org rating4.8 / 5 from 10 ratings
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records Redirect to login if not logged in version 1.7.0 as active, updated 8y ago and tested up to WordPress 5.0.

Overview

About this plugin

Redirects users to the login page if the user is not logged in. After login the user gets redirected to the original entry page. For advanced users a filter is provided to override the redirect.

The principle behind this plugin is to redirect all users – from every post, page, archive, etc. php). Except for the override filter it does nothing else.

Overriding the redirect

  • Note: This plugin may not be for you, a membership plugin might be a better fit. Chris Lema writes excellent reviews of +30 membership plugins here: http://chrislema.com/category/memberships-plugins/

If you do have a need for this plugin and you want to exclude specific views under specific conditions, a filter is provided to override the redirect.

To override the redirect the filter must return a boolean value of true. WordPress core provides many conditional tags that either return true or false or you can write your own conditionals.

Take a look at the Conditional Tags page on The WordPress Codex for some inspiration.

org/Conditional_Tags

Usage:

php of your theme or create a new file in wp-content/mu-plugins/ if you do not wish to edit your theme.

Note: Be carefull not to use multiple filters at the same time as that may cause unexpected results. Instead use multiple conditions in one filter.

-

Override if the front page is either posts or a page:

add_filter( ‘rtl_override_redirect’, ‘is_front_page’ );

-

Override if the post is ‘hello-world’:

add_filter( ‘rtl_override_redirect’, function() {

return is_single( ‘hello-world’ );

});

-

Override if the page is ‘sample-page’:

add_filter( ‘rtl_override_redirect’, function() {

return is_page( ‘sample-page’ );

});

-

Override if the page ID is 42, the slug is ‘sample-page’ or the title is ‘About Me’:

add_filter( ‘rtl_override_redirect’, function() {

return is_page( array( 42, ‘sample-page’, ‘About Me’ ) );

});

-

Override if the page ID is 42 or a post is ‘hello-world’:

add_filter( ‘rtl_override_redirect’, function() {

if ( is_page( 42 ) || is_single( ‘hello-world’ ) ) {

return true;

}

});

WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • login
  • redirect
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 5.0

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 5.0.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to5.0
Minimum requirementsWordPress 3.0.1 · PHP not listed
Update activity13 Sept 20188y ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.