Limit access to wp_admin

IMHO this is not the best method of protecting your WP Admin. IPs can be spoofed. This method also restricts you to specific IPs which can be annoying if you wish to access it from a different office/location. I’d recommend either a simple server-based password protection on the wp-admin directory. Of course, the downside is … Read more

Restricting user login by IP address

IP address validation during authentication – for a selected user only Here’s a way to hook into the authenticate filter and validate the IP address for a given user during authentication. The user can see the invalid IP address error like shown here: /** * Validate IP Address During Authentication – For A Given User … Read more

Is it possible to get the currently logged in admin’s IP?

This functionality is not directly available, you’ll have to track the logins inside the database(probably as a transient) & check if that transient is available. function check_for_admin() { $user = wp_get_current_user(); if(in_array(‘administrator’, $user->roles)) set_transient(‘admin_ip’, get_ip(), 60*10); } add_action(‘init’, ‘check_for_admin’); After that you can use get_transient(‘admin_ip’) & check if it’s available For retrieving the IP, you … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)