Can anyone please tell me where can I find the postal address of a user ? Actually I want to fetch the postal address of a user whose email id I have, but I m not able to find where the postal address is stored (in which table)
Asked
Active
Viewed 864 times
1
-
1Unmodified WordPress doesn't gather or store postal addresses from registered users. So, there are two possibilities: (1) what you want is not available or (2) your WordPress instance is using a plugin of some sort. If it's the second choice, please [edit] your question to give more details. – O. Jones Feb 02 '17 at 17:58
-
On the top right corner, there is an option of 'edit my profile' clicking on that, takes me to a page, where I can fill all information about me like postal address, social networking links etc. I want to know where that data is saved. @O. Jones – user7324674 Feb 02 '17 at 18:01
-
When you have a plugin installed like WooCommerce, then you have a postal address. See : http://stackoverflow.com/questions/19155682/woocommerce-get-and-set-shipping-billing-addresss-postcode and https://codex.wordpress.org/Function_Reference/get_user_meta – Christina Feb 02 '17 at 18:29
-
@Christina. Thanks for the info, I had a plugin installed that was doing that – user7324674 Feb 04 '17 at 13:47
1 Answers
0
An unmodified WordPress instance has a wp_users
and a wp_usermeta
table.
You can obtain a list of users by given name and surname like so
SELECT u.ID, u.user_nicename, u.user_email,
f.meta_value first_name, l.meta_value last_name
FROM wp_users u
LEFT JOIN wp_usermeta f ON u.ID = f.user_id AND f.meta_key = 'first_name'
LEFT JOIN wp_usermeta l ON u.ID = l.user_id AND l.meta_key = 'last_name'
As I've mentioned, unmodified WordPress doesn't gather postal addresses. If you have a plugin doing that, it may put the information in wp_usermeta. Or it may put it in some other plugin-defined table.
If you're planning to work in WordPress, it's best to read the codex. https://codex.wordpress.org/Database_Description

O. Jones
- 103,626
- 17
- 118
- 172