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

Removing username from the ‘wordpress_logged_in’ cookie

Short introduction After quick look inside WP source code, I think I’ve found solution… WordPress uses two functions to set and parse auth cookies: wp_generate_auth_cookie wp_parse_auth_cookie There is a filter in wp_generate_auth_cookie called auth_cookie which you probably could use to change the contents of cookie, but there is no filter inside wp_parse_auth_cookie, but… Both of … Read more

Categories login Tags cookies, login, session

‘Password field is empty’ error when using autofill in Chrome

The JavaScript function wp_attempt_focus is causing this issue. The function fires shortly after page load, clears the form and focuses on it, forcing users to manually enter their login information. Chrome is filling in the username and password automatically, just milliseconds before the JS function clears the field. Chrome does not properly pick up the … Read more

Categories login Tags errors, google-chrome, login

I can’t access my site via wp-admin

Try disabling all your plugins by moving or deleting them from your /wp-content/plugins/ folder. Do this by FTP or by your host’s control panel. If this doesn’t work, log in to the server via FTP, and upload a fresh copy of WordPress. This will fix your wp-admin, and any other folders or files that have … Read more

Categories login Tags login

Disallow user from editing their own profile information

great answer, to take this a step further and for anyone looking to apply this to all non-admin users (e.g. contributers, editors etc.) // ===== remove edit profile link from admin bar and side menu and kill profile page if not an admin if( !current_user_can(‘activate_plugins’) ) { function mytheme_admin_bar_render() { global $wp_admin_bar; $wp_admin_bar->remove_menu(‘edit-profile’, ‘user-actions’); } … Read more

Categories login Tags login, profiles, user-roles

Check for correct username on custom login form

The code he posted in that tutorial (very nice BTW) post’s the form to the build-in “reset password” module which redirects to the login.php on error, but you can change that and build your own based on the original and add it to the template page, change: <form method=”post” action=”<?php echo site_url(‘wp-login.php?action=lostpassword’, ‘login_post’) ?>” class=”wp-user-form”> … Read more

Categories login Tags forms, login, password, Reset

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

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
Older posts
Newer posts
← Previous Page1 … Page72 Page73 Page74 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