All Questions
2,085 questions
0
votes
1
answer
1k
views
What is correct way to change user's email?
When a user updates their email address we are seeing that their old email address becomes unavailable to register. This is undesirable.
It appears this is based on the user_login and user_nicename ...
0
votes
1
answer
724
views
SQL Bulk update all Wordpress user's nicknames to firstname + lastname format
I'm trying to bulk update all my users on one of my Wordpress sites to so that their nicknames aren't the default username but have the format firstname + lastname instead.
I've put together this code ...
0
votes
1
answer
35
views
Load user by specific role
I need to load only the subscribers
$args = array('role' => 'Subscriber');
$subscribers = get_users($args);
but with this, it returns also the users that are subscriber AND other role (I need to ...
0
votes
0
answers
38
views
Can we hide a certain user in WP?
Is it possible to hide a user in Users panel of WordPress without using any plugin. I had achieve this using plugins but I want to do it the old fashion way if its possible, like write a code in ...
0
votes
1
answer
139
views
Random users always showing same 8 users
I am trying to display some random users on the page. It is changing the order of the users it is showing, but it is only showing the same users instead of randomizing from all users in the database.
...
1
vote
1
answer
69
views
Stopping user deletion from running on error
I am writing the following code to do some cleanup before deleting a user via the admin area
function delete_user_custom_data ($user_id) {
$result = do_some_cleanp($user_id); // The ...
1
vote
0
answers
295
views
Four columns in the wp_users table
I am writing custom code to allow users of my site delete their own accounts from the front-end (i.e., they do not have to logon to the WordPress admin area to perform certain actions, but rather I ...
0
votes
0
answers
196
views
Migrate Users From laravel to wordpress
we used Laravel before , and now we are moving to Wordpress, so we need to migrate all users including the passwords , is this possible?
thanks
0
votes
2
answers
80
views
Redirect logged on user to a specific page based on wp user role, page id
I am trying to redirect users(subscribers) to a particular page based on the following conditions
1. (subscriber) user is logged on 2. specific page id is matched 3. wp user role = subscriber which is ...
1
vote
1
answer
497
views
Rule to redirect non logged in User to Custom Registration/login Page in .htaccess file
I am trying to redirect not logged in users from the "/purchaseads/purchase.php" to custom registration/login url "/purchaseads/registrationurl"on wordpress website. Unfortunately ...
1
vote
0
answers
26
views
Custom user login page by creating a plugin
I am creating a custom user interface (separate from the WordPress user system) that relies heavy on values from a mysql database. I have figured out how to access these values, and with PHP files ...
1
vote
1
answer
1k
views
How can I show a button in WordPress but make it unclickable unless logged in?
I'm hoping someone can point me in the right direction. I don't wish to have any of my Wordpress site hidden, but i have an HTML button in my post content. I wish for the button to be visible to ...
1
vote
1
answer
52
views
Register visits of my pages in wordpresss
I have a shortcode that obtains the name of the person logged into wordpress, I would like that shortcode when the person enters a page where I have my shortcode create a .text file and save their ...
1
vote
1
answer
1k
views
Force redirect not logged in user to (wp-login.php or wp-admin) for specific page
I am currently using a Wordpress plugin (Pagerestrict plugin which references URLS based on Page ID/Slugs)to restrict certain pages to logged in users only. This plugin works fine with standard ...
0
votes
0
answers
106
views
How to remember which page the user was on before logout?
I want to make a website with restricted user access. I have found several plugins to do that. Now I want my wordpress website to remember the page the user was on before they logout. Besides that, I ...
0
votes
0
answers
257
views
Easily adding multiple existing users to a multisite site
I manage a multisite network for a school. The sites are private (password protected), but users within the network should be allowed to access other sites as subscribers. (i.e. all students in a ...
1
vote
1
answer
1k
views
Warning: Use of undefined constant HTTP_USER_AGENT - assumed 'HTTP_USER_AGENT' (this will throw an Error in a future version of PHP)
I am new to this and I need help in figuring out how to fix this error:
Warning: Use of undefined constant HTTP_USER_AGENT - assumed 'HTTP_USER_AGENT' (this will throw an Error in a future version of ...
0
votes
1
answer
69
views
When I enter password, I'm redirected to the WordPress login form
I have a page at http://localhost/wix/dss/ when I enter, I get redirected to http://localhost/wix/wp-login.php with the error message
Error: The password you entered for the username ak is incorrect....
1
vote
1
answer
55
views
Some weird users in database
I've noticed that I have some users that seem fraudulent in my database (in the wp_users column). And the curious thing is that they don't appear in the users list in the admin panel.
How could this ...
0
votes
0
answers
162
views
How to display extra fields for user
I have searched for a solution to this for days without any luck.
I have added a new field to my user profile record with the plugin: Profile Extra Fields.
How do I get this field value display on my ...
1
vote
1
answer
1k
views
Display custom user profile fields in wordpress
New to wordpress development. I was trying to solve the problem of adding extra fields to my wordpress logged in subscriber user profile area, and also echoing the field values in my custom page ...
0
votes
2
answers
820
views
Unable to change email address of admin on localhost
If I try to change my email address, it will say it has sent a confirmation email to the new email address. But, I do not see any email request to that email.
Is there a way to troubleshoot this or ...
0
votes
1
answer
1k
views
SQL to set Display Name to First Name + Last Name
I'm trying to set the wp_users.display_name for a rather larger users db using SQL query.
Got till this point:
SELECT x.display_name, x.first_name, x.last_name
FROM
(SELECT
u.display_name,
f....
0
votes
1
answer
59
views
Load Custom Field to User Profile as per User Role using Ajax
I am currently developing a plugin for online doctor booking for patients. Doctor and Patient both need to register on the site. The users (doctors and patients) can be managed from the Users section.
...
1
vote
0
answers
102
views
How to make custom column Admin>Users sortable?
I have a few hundred users (customers) to delete, specifically those that registered before 2019 and have zero orders. I've added the following code to my child theme functions file in order to add a ...
0
votes
2
answers
632
views
How to make WordPress 'editor' role to list/view/add/edit users only with the role 'author'?
I have added some extra capabilities to the existing 'editor' role in wordpress with:
function add_uedit_caps() {
$role = get_role('editor');
$role->add_cap('create_users');
$role->...
0
votes
1
answer
1k
views
Display a list of users who have viewed the post you are viewing
How would I display a list of users who have viewed the post you are viewing?
0
votes
0
answers
306
views
Cannot update newly added User field using wp_update_user
I want to add a new attribute to the wp_user table, "twitter_id" for example.
I added the new column to the wp_user table, and it is added correctly. I get the current user (as I want to ...
0
votes
0
answers
50
views
Is it possible assign a secondary existing role to already existing one?
Im interested to know if it possible Assign a secondary role IF the user it register by a specific role.
For example:
If the user register as "OWNER" wordpress must assign the existing user ...
0
votes
0
answers
81
views
Why User_login key doesn't work with wp_update_user()
I recently was playing with wp_update_user(). I faced an issue while changing the user_login key. Others like user_nicename or other fields change, but user_login doesn't change even everything looks ...
0
votes
0
answers
14
views
Default new users to no admin bar [duplicate]
I want to be able to default all new users created with the wp_login (register) box to have the user option:
Show Toolbar when viewing site
set to unchecked. I have the facility to then jump into wp-...
0
votes
1
answer
63
views
Block editor completely gone for second of two super user
tl;dr: Two super users in a blog network. 15 sites. When second user logs-in block editor is gone. I can see Gutenberg > Demo menu item, I can open "Welcome to Gutenberg Editor" demo page,...
0
votes
0
answers
52
views
How to implement data residency in my WordPress site
I am developing a WordPress multi-site with woo-commerce and subscription plugin. This site will be used in several country like Bangladesh, Australia, United States and Canada.
But I want user’s data ...
0
votes
0
answers
131
views
How to grab data after wp user search is complete
In the wp backend wp-admin > users.php there is a search field which we can use to search for particular users.
Let's say we search for a string 'test' and it retrieves 3 users.
How can we grab the ...
1
vote
1
answer
777
views
How to add taxonomy to user?
I added some custom taxonomy to a CPT with:
register_taxonomy( 'sport', 'activity', [
'label' => 'Sport',
'rewrite' => [ 'slug' => 'sport'],
'hierarchical' => ...
0
votes
0
answers
74
views
Show posts who published after registration date
i will make a membership system in WordPress with indeed ultimate membership pro and I would like users not to see posts that were made before the date they registered.
I want: They can still see the ...
1
vote
0
answers
26
views
how to know when the user is in specific part of the website and when he leaves that part and display the data in the admin dashboard
I want to display for the admin when a user visits a page and when he leaves that page
the page is for example test.test/my-dashboard. and it's only available for the logged in users.
the admin knows ...
1
vote
2
answers
3k
views
When I try to login in wordpress it is showing "USER Doesn't Exists"
The main Issues is that I am entering the email address & password that I used in creating my WordPress site in digital but It shows that the email address & username doesn’t exist even I ...
0
votes
1
answer
561
views
how to retrieve user via rest api using custom meta and/or email
I've successfully added a custom meta key / value for a user and managed to display it in the rest API however I'm not sure how I can retrieve the user based on this key.
For example
$fields = ['trdr']...
0
votes
1
answer
62
views
I need a link that directs the user that is logged to his profile
I want a link in the form to an image in the frontpage, that direct the user that is logged to the subscription packages that are on its profile:
The link look like this:
https://mywebsite.co.uk/...
1
vote
1
answer
29
views
Add value in user table when user is created
I am trying to insert a value into a column after a user registers.
Sadly after my test I get the error "Write Error" what could be wrong with the hook?
function org_teammember( $user_id ) {
...
0
votes
0
answers
136
views
Use WP cookie to authentificate user on an external app
Is it possible to authentificate a logged in WP user by it's wp auth cookie from an external app (simple JS webapp on a different domain)?
The setup is:
My webapp is on domain.com/generator/
The ...
0
votes
1
answer
140
views
Why is my WordPress login credentials missing, but work with WooCommerce?
I have a constant issue where my login credentials are not found when trying to enter WordPress.org. Password reset option is not possible as my username and email address is not found. Yet, I am ...
0
votes
0
answers
232
views
How to hide "Change role to" dropdown on Users admin menu
How can I hide the "Change role to" dropdown?
0
votes
0
answers
129
views
How to count active users on a specific page
I need to limit the number of active users on a particular page when there are at maximum 200 users on it. I've tried to document myself to figure out how it can be done but I can't find any good ...
0
votes
1
answer
32
views
Is this a hack? WordPress Usernames of every website we have changed into one single name automatically?
We host a lot of WordPress websites, today we noticed that almost every WordPress website we hosted changed their users' usernames into one single name, not only one user all the users of a website is ...
1
vote
2
answers
1k
views
No user found when using REST API
When I use a REST route whilst logged in, and call wp_get_current_user(), no user is found. However, the request method, eg POST is processed without issue. Example REST route registration.
...
0
votes
1
answer
2k
views
WordPress is creating nonce as a logged in user but verifying it incorrectly
I'm having trouble validating a nonce created with wp_create_nonce() inside a hidden input with the name nonce in an html form:
<input type="hidden" name="nonce" value="<...
0
votes
1
answer
161
views
Is it possible to create new user from external form using REST API?
I created a new user (called external) in a WordPress site with manage users capabilites. I installed Application Passwords plugin to generate a token for that user.
Now is it possibile to create a ...
1
vote
1
answer
1k
views
Why is it that not all users have a 'session_tokens' meta_key record in the usermeta table?
I've created my own code based on this good article - https://shocksolution.com/2019/04/16/find-last-login-time-for-wordpress-users-in-the-sql-database/ to get the last login date for a user.
I'm ...