Instead of adding new columns to the WordPress database, you might want to use the wp_usermeta
table. It is used to store any kind of data about your users (just like the wp_postmeta
for your posts and pages).
To add fields on the registration form you can use the user_new_form
action which is triggered by the admin form or the register_form
on the registration form on the website.
Then, hook into the insert_user_meta
filter (triggered after the user save) and add the user meta that you submitted with your form.
Finally, as you probably need to display those values in the user edit form, try to hook into edit_user_profile
to add your custom fields in the user profile page.
When posting the form, the user update function will automatically trigger the same function you used to add the user meta.
Related Posts:
- MySQL: Can’t create table (errno: 150)
- Moving database with phpMyAdmin
- Change sticky status of posts from phpMyAdmin
- Restose content from revisions – sql query
- Better way to migrate to server?
- How delete post_content records of specific category from phpmyadmin
- Reset post IDs with all post meta
- Want to delete woocommerce coupon in bulk from phpmyadmin based on published date
- What is a stored procedure?
- Unknown column in ‘field list’ error on MySQL Update query
- SQL Inner-join with 3 tables?
- Conversion failed when converting date and/or time from character string while inserting datetime
- MySQL create table if not exists and insert record only if table was created
- error, string or binary data would be truncated when trying to insert
- Why do we need “Relationships” between tables at all?
- Using group by on multiple columns
- How to declare a variable in MySQL?
- ORA-01843 not a valid month- Comparing Dates
- How do I escape a single quote in SQL Server?
- Teradata: how to convert varchar value (format ‘dd.mm.yyyy’) to date (format ‘yyyy-mm-dd’ )?
- How Stuff and ‘For Xml Path’ work in SQL Server?
- Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
- Oracle SELECT TOP 10 records
- must appear in the GROUP BY clause or be used in an aggregate function
- How can I return pivot table output in MySQL?
- The multi-part identifier could not be bound
- SQLite – UPSERT *not* INSERT or REPLACE
- how to drop partition without dropping data in MySQL?
- Simple way to calculate median with MySQL
- The ALTER TABLE statement conflicted with the FOREIGN KEY constraint
- Error 1046 No database Selected, how to resolve?
- How do I do multiple CASE WHEN conditions using SQL Server 2008?
- Insert text with single quotes in PostgreSQL
- SQL Server IF NOT EXISTS Usage?
- How to insert date values into table
- Arithmetic overflow error converting numeric to data type numeric
- I want to use CASE statement to update some records in sql server 2005
- SELECT DISTINCT on one column
- how to remove time from datetime
- TSQL PIVOT MULTIPLE COLUMNS
- MySQL – UPDATE multiple rows with different values in one query
- How to create a MySQL hierarchical recursive query?
- Microsoft OLE DB Provider for SQL Server error ‘80004005’
- Query to convert from datetime to date mysql
- How to query MongoDB with “like”
- Equivalent of Oracle’s RowID in SQL Server
- Subtract one day from datetime
- MySQL equivalent of DECODE function in Oracle
- what is the difference between triggers, assertions and checks (in database)
- Replacing NULL with 0 in a SQL server query
- How to delete from multiple tables in MySQL?
- How to copy a row and insert in same table with a autoincrement field in MySQL?
- Backup a single table with its data from a database in sql server 2008
- Error converting data type varchar
- updating table rows in postgres using subquery
- I want to use CASE statement to update some records in sql server 2005
- Cannot create an instance of OLE DB provider Microsoft.Jet.OLEDB.4.0 for linked server null
- ORDER BY items must appear in the select list if SELECT DISTINCT is specified
- ROW_NUMBER() in MySQ
- Foreign key references invalid table
- Is there a coalesce-like function in Excel?
- What are database constraints?
- Postgresql column reference “id” is ambiguous
- Inner Joining three tables
- How do I view the Explain Plan in Oracle Sql developer?
- ORA-01779: cannot modify a column which maps to a non key-preserved table
- SUM OVER PARTITION BY
- MySQL LIKE IN()?
- Filter data based on date in sql
- Varchar invalid for Sum operator
- SQL: How to properly check if a record exists
- ora-06553 pls-306 wrong number or types of arguments in call to ‘ogc_x’
- SQL query to extract only the “current” wp_posts?
- Sorting search results by taxonomy terms
- SQL select of users by metadata
- How to properly sanitize strings without $wpdb->prepare?
- How to retrieve sticky post in raw sql?
- How to remove in the wordpress database all posts revisions except the last three?
- Would manually deleting the dumping data fix a “#1062 – Duplicate entry ‘1’ for key ‘PRIMARY'” phpMyAdmin error?
- Backticks (`) Instead of Single Quotes (‘) in an SQL Statement?
- $wpdb get_var issue
- posts_where Fails with More than One Custom Field in Query
- Inserting rows into a custom table, when plugin is activated
- WordPress database error: You have an error in your SQL syntax
- Inner Join user tables to select users with roles
- $wpdb->prepare with LIKE returning blank array instead of rows
- Posts modified in the last 48 hours
- How to migrate a database from a server to another
- Removing posts by sql
- Why line returns are not reapply after doing esc_sql?
- SQL: Select wordpress posts with given text string and add a custom field to them?
- post id not displaying
- How to export 2 week’s worth of posts
- I wanted to Know that how can I give ingore to 0000-00-00 in my config file
- Adding wordpress posts using phpmyadmin
- How to retrieve user data based on role using SQL?
- Insert multiple checkbox values
- How to get EVENT based on startday, using BETWEEN
- wpdb prepare without placeholder
- This SQL request call all time and overload my server : SELECT meta_value FROM wp_sitemeta WHERE meta_key = ‘wp_installer_network’ AND site_id = 1