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

Admin username and password

Here’s an easy way to enumerate user names (using standard WP install): just use a URL like this: https://www.example.com/?user=1 . (Added Note: you might need to use an actual page/post URL, as in https://www.example.com/a-real-page?user=1 .) You’ll get back info about that user account (the first user account, which will be the admin-level user), and then … Read more

Categories PHP Tags login, php, security, wp-admin

Members only site – still need the lost password page accessible

I believe your if statement is incorrect it should be an AND (&&) not OR so try if ( ! is_user_logged_in() && ! is_page( ‘lost-password’ ) ) { EDIT Try using $object = get_queried_object() for checking the post slug $object = get_queried_object(); if ( ! is_user_logged_in() && ( ! $object || ‘my-account’ !== $object->post_name ) … Read more

Categories functions Tags functions, login

Change username before login

You can use wp_authenticate filter for that… This filter is fired before the user is authenticated. Params are passed by reference, so you can modify them. // user name is passed in by reference function wp_authenticate_by_email( &$username ) { // make sure that the condition below works for you if ( is_numeric( $username ) && … Read more

Categories filters Tags filters, hooks, login, username, wp-login-form

Today, without warning, all admin panel logins redirect to home page after login. non-admin users logins work well

So, we figured out what it was. In the options table (wp_options for some, we chose to do away with the wp prefix), there’s a user_roles (or wp_user_roles value). One of the plugins we used (Yoast SEO in this case) had an update that zapped the value of that option, removing the Administrator role from … Read more

Categories wp-admin Tags login, wp-admin

When can I safely `wp_set_auth_cookie`?

If the request is not authenticated by the time it enters init you can run your authentication logic if you wish. If you want to be mindful of other plugins, you could run on init with a priority of 0 as an example (or a negative value). Plugins (may) hook onto init at the default … Read more

Categories login Tags login

Can’t access WordPress as an admin – but I can log in as a user!

You can check the user credentials in phpmyadmin by looking in the _usermeta table for a the meta_key column entry called wp_capabilities. Since you only have one user it will be the only entry. If you have more than one user, I’d guess you’re the user with ID 1 so match wp_capabilities column with user_id … Read more

Categories wp-admin Tags login, user-access, wp-admin

How can we redirect user from login page to home page if user is logged in WordPress?

You can check the current page being loaded through the $pagenow global variable. Both login and registration is handled through wp-login.php. Adding this to the functions.php of your theme should work: <?php add_action(‘init’, function () { if ($GLOBALS[‘pagenow’] === ‘wp-login.php’ && is_user_logged_in() && (!isset($_GET[‘action’]) || $_GET[‘action’] !== ‘logout’)) { wp_redirect(home_url()); exit; } }); EDIT: Added … Read more

Categories login Tags login

Customizing login error messages

I can’t see your complete code… However, your code should look like this: function my_custom_error_messages( $error ) { global $errors; $err_codes = $errors->get_error_codes(); // Invalid username. // Default: ‘<strong>ERROR</strong>: Invalid username. <a href=”%s”>Lost your password</a>?’ if ( in_array( ‘invalid_username’, $err_codes ) ) { $error=”<strong>ERROR</strong>: Wrong username.”; } // Incorrect password. // Default: ‘<strong>ERROR</strong>: The password … Read more

Categories login Tags errors, login, wp-login-form

How to edit comment_reply_link

you can simple make a check if user is logged in and show him the reply button, if is not you can show him a custom link to your login file. something like this: <?php if ( !is_user_logged_in() ) : ?> <a href=”https://wordpress.stackexchange.com/questions/5624/<?php bloginfo(“url’); ?>/login”><?php _e(‘Reply’, ‘artdev’); ?></a> <?php else : ?> <?php comment_reply_link() ?> … Read more

Categories login Tags login

Fresh Multisite Install – Can’t Log In

I am guessing that you are using subdomains instead of sub folders for your multisite set up? This is an issue that appears to happen when using subdomains and setting up your multisite manually. I recall this issue happening with WordPress MU a bit ago and it was related to cookies or something and you … Read more

Categories multisite Tags login, multisite
Older posts
Newer posts
← Previous Page1 … Page123 Page124 Page125 … 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