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

wp-login.php — redirect logged in users to custom URL

Could be just a typo. Try writing: is_user_logged_in() Looks like just forgot the () UPDATE: Because you don’t want to redirect on every page load you have to hook your redirect. I here an example (taken and slightly edited from the docs): <?php function daro_login_redirect( $redirect_to, $request, $user ) { //is there a user to … Read more

Categories redirect Tags login, redirect, wp-redirect

Change sign-on URLs for security purposes

Well, considering rewrite and redirect like in comments – choose what fits you best . HOOK wp_login_url(); //this function generate the login url address Example: add_filter( ‘login_url’, ‘another_login_url’, 10, 2); function another_login_url( $force_reauth, $redirect ){ $login_url=”your_chosen_login_url”; if ( !empty($redirect) ) $login_url = add_query_arg( ‘redirect_to’, urlencode( $redirect ), $login_url ); if ( $force_reauth ) $login_url = … Read more

Categories login Tags login

User Login Form Outside the Default wp-login Form

I think this may be a WordPress bug. According to the documentation, wp_signon() is the correct function to log a user in. In your script, you are using is_user_logged_in() to verify the user was correctly logged in after your call to wp_signon(). is_user_logged_in() uses the global $current_user variable which doesn’t appear to get set when … Read more

Categories login Tags login

Redirect to current page after wordpress login

You can use the login_redirect filter to do this. One of the parameters is $request, which is the URL the user is coming from function wpse125952_redirect_to_request( $redirect_to, $request, $user ){ // instead of using $redirect_to we’re redirecting back to $request return $request; } add_filter(‘login_redirect’, ‘wpse125952_redirect_to_request’, 10, 3); The filter could additionally easily be used for … Read more

Categories redirect Tags login, redirect

Login redirect_to loop with reauth=1, cookie expiry set to 1 year in past

This was caused simply by the salts in wp-config.php being at the end of the file, after the call to wp-settings.php (they were inserted by an Ansible script) rather than above the line: /* That’s all, stop editing! Happy publishing. */ 🙁

Categories login Tags cookies, login, site-url

Can’t access admin dashboard with wp-admin without /index.php after it

It sounds like Apache’s DirectoryIndex may be set “incorrectly”. Try resetting this at the top of your .htaccess file: DirectoryIndex index.php

Categories wp-admin Tags .htaccess, login, redirect, wp-admin

Change “logged in” link in (you must be logged in to post a comment)

To change the login link only in this template, replace the wp_login_url() function call with your login link: ‘must_log_in’ => ‘<p class=”must-log-in”>’ . sprintf( /* translators: %s: login URL */ __( ‘You must be <a href=”https://wordpress.stackexchange.com/questions/258398/%s”>logged in</a> to post a comment.’ ), “https://yourdomain.com/my-account” ) . ‘</p>’, If you want to generally redirect users to another … Read more

Categories customization Tags comment-form, comments, customization, login

How to translate “wrong password” message

We can also use the filter wp_login_errors available in wp-login.php to do the above. Using the same filter you can customize other error messages too like registration, checkmail etc. Use the below code in the active theme’s functions.php file add_filter( ‘wp_login_errors’, ‘override_incorrect_password_msg’, 10, 2 ); function override_incorrect_password_msg( $errors, $redirect_to ) { if( isset( $errors->errors[‘incorrect_password’] ) … Read more

Categories login Tags login

Cookie settings for session across WPML subdomains using custom AJAX login

I continued looking for an answer elsewhere, and found one. Basically, the “cookie domain origin policy” was the issue, not sign-in process. I was calling domain.com/wp-admin/admin-ajax.php from a subdomain fr.domain.com. I called fr.domain.com/wp-admin/admin-ajax.php instead, and that worked.

Categories login Tags cookies, login, subdomains

Make wordpress admin failed login attempt return 401

WordPress handles login failed in two ways: If it is a bad credential, and both username and password have a value, then this action can be captured by wp_login_failed If both, or one, of the options are empty, then WordPress generates the error object as the first parameter in the authenticate filter; it does not … Read more

Categories login Tags login, security
Older posts
Newer posts
← Previous Page1 … Page142 Page143 Page144 … Page164 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
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 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