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

wp-login-form

How to get login data (session) outside WordPress?

I solved my problem, and it could definitely help others too. The problem was with cookies since my folder structure was like this : mysite.com mysite.com/mypage.php mysite/wordpress/ the cookies were only valid for wordpress folder, and it’s subdirectories. In order to activate the cookies outside wordpress, I installed the root Cookie plugin, and everything works … Read more

Categories login Tags cookies, login, session, wp-login-form

Check if user is logged in else login page

if(!current_user_can(‘administrator’)) { wp_redirect( wp_login_url() ); } This will redirect non-admins to login URL. Of course, logged in non-admins will be a bit confused. You’ll want to run this before get_header()

Categories admin Tags admin, wp-login-form

Replace wordpress login logo with custom text

You will first need to remove the wordpress logo from the login screen. The wordpress logo is added by css, so you will need to change the css and hook that to the login_enqueue_scripts action hook function my_login_logo() { ?> <style type=”text/css”> body.login div#login h1 a { background-image: none; background-size: 0 0; height: 0; margin: … Read more

Categories wp-admin Tags wp-admin, wp-login-form

Login with email (WP Modal Login)

I’m using this simple action, and it works like a charm. 🙂 <?php /** Plugin Name: (#111223) User Login with Mail Address */     add_action( ‘wp_authenticate’, ‘wpse111223_login_with_email_address’ ); function wpse111223_login_with_email_address( $username ) { $user = get_user_by_email( $username ); if ( ! empty( $user->user_login ) ) $username = $user->user_login; return $username; } It hooks to … Read more

Categories plugins Tags login, plugins, wp-login-form

change register url on wp-login page

Code from @bainternet’s website. function wpse127636_register_url($link){ /* Change wp registration url */ return str_replace(site_url(‘wp-login.php?action=register’, ‘login’),site_url(‘register’, ‘login’),$link); } add_filter(‘register’,’wpse127636_register_url’); function wpse127636_fix_register_urls($url, $path, $orig_scheme){ /* Site URL hack to overwrite register url http://en.bainternet.info/2012/wordpress-easy-login-url-with-no-htaccess */ if ($orig_scheme !== ‘login’) return $url; if ($path == ‘wp-login.php?action=register’) return site_url(‘register’, ‘login’); return $url; } add_filter(‘site_url’, ‘wpse127636_fix_register_urls’, 10, 3);

Categories wp-login-form Tags wp-login-form

Remove lost password form and URL

Hi Please try to use this in your functions.php it will redirect user to login form when user try to access lost password page: add_action(‘init’,’possibly_redirect’); function possibly_redirect(){ if (isset( $_GET[‘action’] )){ if ( in_array( $_GET[‘action’], array(‘lostpassword’, ‘retrievepassword’) ) ) { wp_redirect( ‘/wp-login.php’ ); exit; } } } Or Please follow below approach used from this … Read more

Categories redirect Tags password, redirect, wp-login-form

send users logging in from wp-login.php directly to home page of site, rather than dashboard

You can achieve this by using the Plugin Peter’s Login Redirect. It allows you to send users to a specific page after login, based on the user capabilities. So you can allow administrators to go to the admin section, while members are redirected to the front page. If you want to prevent users from ever … Read more

Categories login Tags dashboard, login, wp-login-form

WordPress 4 invalid username special charachters issue

Are you creating your users via regular means or somehow importing them? Trying to create such user WP prevents me from doing so: ERROR: This username is invalid because it uses illegal characters. Please enter a valid username. The reason for that is that username is validated with validate_username(), which runs sanitize_user() in strict mode. … Read more

Categories PHP Tags htmlspecialchars-decode, login, php, wp-login-form

hook for lostpassword form

What happen if you use this instead ? public function processCaptcha() { if($_POST[‘captcha’]!=$captcha){ global $errors; $errors->add(‘invalid’, ‘<strong>ERROR</strong>: invalid captcha.’); } }

Categories hooks Tags hooks, wp-login-form

Positioning the “Lost your password?” and “← Back to Site”

although I can play around with the CSS If you are not going to use CSS (or jQuery) to modify the position of these elements, you have to create your own login form: Customizing_the_Login_Form#Make_a_Custom_Login_Page. There is no hook in wp-login.php that allows to move these elements inside the form field. Related: Where to put my … Read more

Categories login Tags login, wp-login-form
Older posts
Newer posts
← Previous Page1 … Page29 Page30 Page31 … Page35 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