Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

login

Redirect loop when trying to login to /wp-admin/ [duplicate]

I found a solution. In wp-config.php add: define(‘FORCE_SSL_ADMIN’, false); In my situation, I migrated to https from http, and use plugin Rename wp-login.php My wp-config.php contained the lines: define(‘WP_SITEURL’,’https://example.com’); define(‘WP_HOME’,’https://example.com’); Without the line define(‘FORCE_SSL_ADMIN’, false);, a redirect loop occurs.

Categories loop Tags login, loop

How to prefill WordPress registration with social details

I’d recommend Auth0 plugin https://wordpress.org/plugins/auth0/ oAuth plugins should auto populate the data that your API call allows. And your users should be able to edit their profiles also. LinkedIn also has an AutoFill function here: https://docs.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/plugins/autofill-plugin

Categories login Tags login, social-connect, user-registration

How reduce wordpress login session timeout time?

You just need to add your filter hook like this: function myplugin_cookie_expiration( $expiration, $user_id, $remember ) { return $remember ? $expiration : 600; } add_filter( ‘auth_cookie_expiration’, ‘myplugin_cookie_expiration’, 99, 3 ); You can add it to your theme’s functions.php file.

Categories login Tags login, logout, session

Preventing session timeout

By default, WordPress makes your login session cookie expire in 48 hours (or on browser close), or 14 days if you check the “Remember Me” box. Maybe you have some plugins which force your login cookie to expire. You could manually add the code below on your functions.php to extend your cookie expiry to whatever … Read more

Categories login Tags login, session

User registration followed by automatic login

Basically to log a user in you can use: //Login the user $creds = array(); $creds[‘user_login’] = $login; $creds[‘user_password’] = $password; if ( !empty( $remember ) ){ $creds[‘remember’] = true; } $user = wp_signon( $creds, true ); but that is only when you have the password and login so you can create your own register … Read more

Categories PHP Tags login, php, registered

SSO / authentication integration with external ‘directory service’

OK, the approach that’s working for me is as follows: Assume that the main site user database is authoritative. The main site login cookie contains an ID and a hash of the site password. Get the cookie from the main site and revalidate it against the main site’s authentication API If valid, use the email … Read more

Categories login Tags login, rest-api, single-sign-on, user-registration, xml-rpc

Separate registration and login for different roles

Creating two separate registration for different roles is easy: //create a hidden field for role add_action(‘register_form’,’add_hidden_role_field’); function add_hidden_role_field(){ if (isset($_GET[‘role’])){ echo ‘<input id=”user_email” type=”hidden” tabindex=”20″ size=”25″ value=”‘.$_GET[‘role’].'” name=”role”/>’; } } add_action(‘user_register’, ‘update_role’); //save the the role function update_role($user_id, $password=””, $meta=array()) { if (isset($_POST[‘role’])){ $userdata = array(); $userdata[‘ID’] = $user_id; $userdata[‘role’] = $_POST[‘role’]; //only allow if … Read more

Categories login Tags login, user-registration, user-roles

Redirect user to original url after login?

You can do that easily. You just need to specify a redirection parameter. If you are using a login link on the homepage to go to the login page, then @sisir’s solution is correct. <?php echo wp_login_url( $_SERVER[“HTTP_HOST”] . $_SERVER[“REQUEST_URI”] ); ?> If you are using a custom form on the frontpage, then inside the … Read more

Categories redirect Tags login, redirect, urls

Login page ERROR: Cookies are blocked due to unexpected output

This error is generated in wp-login.php , it happens if server is unable to set cookies, this can happen due to several reasons, one of the common issue is: output being sent before setting up of cookies. Try out following options: Update WordPress core, if it is not up to date change theme, if you … Read more

Categories login Tags cookies, login, wp-config

Add “Logout” link to navigation menu

You can achieve this using the wp_nav_menu_items hook. Let’s have a look at the following piece of code which shows the login/logout link on the primary menu location. add_filter( ‘wp_nav_menu_items’, ‘wti_loginout_menu_link’, 10, 2 ); function wti_loginout_menu_link( $items, $args ) { if ($args->theme_location == ‘primary’) { if (is_user_logged_in()) { $items .= ‘<li class=”right”><a href=”‘. wp_logout_url() .'”>’. … Read more

Categories menus Tags login, menus
Older posts
Newer posts
← Previous Page1 … Page159 Page160 Page161 Page162 Next →
+ More

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
Next Page »
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress