Answer the question
In order to leave comments, you need to log in
How to create two table registration in wordpress?
Hello, I need your help, I can't do it myself!
There are two sites site.ru and site.com, there is a need that when adding a new user through the admin panel, the data is recorded in two tables.
The wp_users table and the wp_com_users table have the same data, i.e. the logins and passwords are the same.
It is necessary to make sure that when registering on site.ru from the wp_users table, the data is copied to wp_com_users. Thank you in
advance for your answer.
Answer the question
In order to leave comments, you need to log in
I would advise you to approach the problem from a different angle. In fact, users should be created in one table, more precisely in one pair of tables ( wp_users
and wp_usermeta
), and stored in a single instance. And on the second site, you simply indicate that you need to use this pair of tables from the first site. There wp-config.php
are 2 configuration constants for this:
define( 'CUSTOM_USER_TABLE', $table_prefix.'my_users' );
define( 'CUSTOM_USER_META_TABLE', $table_prefix.'my_usermeta' );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question