table – What is the recommended way to delete users

Question

Features can be written in plugins that store lists of user ids in their own fields in the database. WordPress does not find these associations when you delete a user so code that uses those lists may fail catastrophically.

WordPress does include a “deleted” column in the database and a “user_status” column.

In the WP_User notes on the wordpress site wp_user constructor it refers to the ‘deleted’ column as a wordpress multisite field as if that is current. But setting this value to 1 in the database does not prevent users from being displayed in the users list.

So it looks like WordPress ignores this field.

Can we depend upon the ‘deleted’ field to remain in the WordPress wp_users table so we could filter the users list ourselves or is there a chance that the ‘deleted’ field may disappear in a future wordpress update?

OR

Is there a ‘recommended’ method of deleting users so they do not display in the users list table anymore?

0
codeasaurus 3 weeks 2022-11-11T13:27:13-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse