use this code, it may help you
$users = get_users($args);
if($users) {
foreach($users as $user) {
$user_id = $user->ID;
$shipping_first_name = get_user_meta($user_id, 'shipping_first_name', true);
if($shipping_first_name) {
update_user_meta( $user_id, 'first_name', $shipping_first_name);
}
}
}
for $args – refer link https://codex.wordpress.org/Function_Reference/get_users
Related Posts:
- Updating User Meta with SQL Query
- Set meta_key and meta_value for all registered user in wordpress using sql query [closed]
- How do I join a $wpdb query with user meta using default value if not exist?
- Paypal Post IPN handeling nightmare
- Run Username SQL Query from WordPress Child Theme Functions File
- How do I echo all users’ display_name and their meta_value who have a certain meta_key?
- How to search usermeta table
- MySQL Error: : ‘Access denied for user ‘root’@’localhost’
- Access Denied for User ‘root’@’localhost’ (using password: YES) – No Privileges?
- MySQL Error “Operand should contain 1 column”
- How to use MySQL DECIMAL?
- Access denied for user ‘root@localhost’ (using password:NO)
- MySQL ERROR 1290 (HY000) –secure-file-priv option
- MySQL server startup error ‘The server quit without updating PID file’
- MySQL ERROR 1045 (28000): Access denied for user ‘bill’@’localhost’ (using password: YES)
- How do I quickly rename a MySQL database (change schema name)?
- What does SQL Select symbol || mean?
- Duplicating a MySQL table, indices, and data
- mysql Foreign key constraint is incorrectly formed error
- SELECT * FROM multiple tables. MySQL
- MySQL error code: 1175 during UPDATE in MySQL Workbench
- mysql: SOURCE error 2?
- How to avoid MySQL ‘Deadlock found when trying to get lock; try restarting transaction’
- MySQL foreach loop
- How to find MySQL process list and to kill those processes?
- MySQL IF NOT NULL, then display 1, else display 0
- SQL statement not working – “Operand type clash: date is incompatible with int’
- MySQL Calculate Percentage
- Repair all tables in one go
- Get the new record primary key ID from MySQL insert query?
- How to change collation of database, table, column?
- Failed building wheel for mysql-python
- ERROR 1115 (42000): Unknown character set: ‘utf8mb4’
- Error Code: 1290. The MySQL server is running with the –secure-file-priv option so it cannot execute this statement
- Remove Primary Key in MySQL
- How to get the max of two values in MySQL?
- There can be only one auto column
- mysql: connection refused when trying to connect to localhost using remote IP
- Error: Duplicate entry ‘0’ for key ‘PRIMARY’
- Why are simple updates to wp_postmeta’s “_edit_lock” so slow?
- What’s a good strategy for planning WordPress DB growth?
- Complex meta query with 3 keys
- How to log mysql errors from wordpress core?
- Search multiple meta keys at once
- wpdb Custom Meta Data with 2 conditions
- query to create woocommerce products from images
- How can I SQL update a meta_value to remove the dollar signs that were entered with the value? (so just the value remains)
- Configure WordPress to connect to Mysql DB using SSH tunneling
- How can I make wordpress suppress mysql errors?
- How to Create a Admin User for A WordPress Site via MySQL (PHPMyAdmin)?
- Rewrite database urls
- SQL error #1062 – Duplicate entry ‘1’ for key ‘PRIMARY’ [closed]
- Migrating from Existing MySQL Setup to WordPress
- How to split the a table in database?
- Error: MySQL shutdown unexpectedly [closed]
- mySQL statment count of post in each category and sub category
- Is there a page length limit?
- WordPress tables and aliases?
- What’s the sql for this condition?
- Create a form with custom autocomplete address field and CSV import values
- WordPress insert query is not working : Showing no Error
- How to set MYSQLI_OPT_INT_AND_FLOAT_NATIVE option
- Export Yoast Keywords from MySQL/phpMyAdmin
- Same database; different WordPress
- MySQL query for taxonomy-meta
- Editing mysql tables/database with wordpress or other app/cms
- Sql – Search with serialized Data / better database concept
- How to insert dash (-) into database using wpdb and new_to_publish hook?
- MySQL: How to change url in posts from xxx.com to yyy.org?
- Edit Account – read and write to MySQL
- How to fetch all meta_key and meta_value using post_id wihout duplication of post meta using sql query
- Ubuntu 12.04, Nginx and MySQL issue with WordPress Database
- Upgrade DB Loop – WordPress DB Version Conflict
- WordPress & MySQL , problem with use many array in meta_query
- latency problems with wordpress install (from SQL import)
- Button writing to MYSQL database
- MySQL ‘duplicate entry’ error
- WordPress Dutch characters encoding problem
- wpdb insert into point column in db
- How to show result of sql query in a page?
- Why can’t i come back to older working version of php after ugrade with error log on php 7.2 and 7.3
- Update a user meta key based on WooCommerce product purchase
- How do I insert content of various MySQL fields in post?
- WPDB delivers wrong results from complex queries
- Select latest 2 articles, but only from given category
- CONCAT_WS in custom sql query
- Query does not filter duplicate _sku numbers
- Ordering topics by most replies in X days using MYSQL statement
- MySQL Select within WP Page template
- wp_postmeta – lot of meta fields
- Get data from 3rd table
- Running WordPress from MySQL Cluster with HAPRoxy
- Delete posts with word count less than x number of words
- MySQL: get post_tag items that are tags (not SEO keywords)
- $wpdb->get_var returns 0
- cannot log in to the mysql server (wamp and wordpress)
- SQL command to export post_content from wp_posts using phpMyAdmin
- Why can’t I connect to imported WP DB on local MAMP?
- How to find source of these strange SQL queries?
- How to reduce uncached page generation time?