Users

Simple User Sync

The plugin allows to automatically create users on multiple WordPress websites and then sync their profile changes between selected sites.

Create Users Programmatically

You can create a WordPress user programmatically using either wp_create_user() or wp_insert_user() functions, so in this tutorial I am going to show you the difference between them and we’re also going to take a look at several examples.

There is also a way how you can do that with SQL-requests but it is not exactly creating users programmatically, so we’re not going to uncover it in this tutorial, but you can read more here.

Add a Super Admin User in phpMyAdmin

Sometimes when you work with WordPress multisite network you may need to create a super administrator user not from the dashboard, but from the database with the help of SQL queries.

And in this tutorial I am about to show you how. There are actually only two steps we need to do:

Add a Sortable User Registration Date Column to All Users Page

There are could be different situations in WordPress when you will need to sort users by registration date. For example you may notice that spam users has been registered recently on your website and it is kind of difficult to find them in your users list because by default it is sorted alphabetically.

In this tutorial we are about to create a “Registration date” column just like on the screenshot below and of course, what is most important we are going to make it sortable.

this is how to sort users by registration date in WordPress admin
On this screenshot the default Posts column is hidden, but the Registration Date column is added. And when you click on its title, the users in this table will be sorted by their registration date — descending or ascending (click the title twice).

In order to implement this feature we don’t need to use any plugins (but we could of course), all we need to do is to use three WordPress filter hooks:

  • manage_users_columns – to add a columnt to All Users page,
  • manage_users_custom_column – to display the registration date inside it,
  • manage_users_sortable_columns – to make it sortable.

Let’s get started!

If you don’t know where to insert the code from this tutorial, please check this guide.