0

I need to update user profile field (mainly first name, last name, email and password) from an external website. Wordpress is installed on wordpress.domain.com and external website is at www.domain.com, and both are on two different servers.

Now how can I update user data from the external site (www.domain.com)?

1 Answer 1

0

First you need permission to make changes in db of www.wordpress.domain.com. So for this you have to add the ip of wwww.wordpress.domain.com to www.doamin.com so that they allow to make changes. After that just make a function which allow you to connect to that server and make changes. The query for this is

$pwd = $_POST['pwd'];
$email = $_POST['email'];
$website = $_POST['website'];
$description = $_POST['description'];

wp_update_user( array ('ID' => $userID, 'user_pass' => $pwd, 'user_email' => $email, 'user_url' => $website, 'description' => $description) ) ;

The function wp_update_user is in resgistration.php. But you can make changes by making own query. You can see the field names here. so make changes as you wish.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.