最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

SQL to transform all email addresses in my DB in lowercase

programmeradmin2浏览0评论
Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 4 years ago.

Improve this question

how can I transform all email addresses in my DB in lowercase?

I did an import and all addresses are uppercase and if a user registers again with lowercase the system thinks is another email. So I want to change all the emails to lower to avoid further duplications.

best will be to have a SQL query to do that

Thanks for your help!

Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 4 years ago.

Improve this question

how can I transform all email addresses in my DB in lowercase?

I did an import and all addresses are uppercase and if a user registers again with lowercase the system thinks is another email. So I want to change all the emails to lower to avoid further duplications.

best will be to have a SQL query to do that

Thanks for your help!

Share Improve this question asked Nov 24, 2020 at 19:15 TommasoTommaso 1 6
  • 3 This is clearly not a WP-specific question. – vancoder Commented Nov 24, 2020 at 19:22
  • 2 You're looking for MySQL's LOWER() function, I believe. – Pat J Commented Nov 24, 2020 at 19:55
  • Yes, how can i structure the query? – Tommaso Commented Nov 24, 2020 at 20:24
  • 4 @Tommaso no, it's a general mysql question which it doesn't seem like you've put any effort into solving yourself. Perhaps ask on stackoverflow or dba.stackexchange - this site is for questions regarding WordPress. WordPress uses MySQL but not all MySQL questions are relevant to WordPress. And also, it's a good idea to provide a minimum complete and verifiable example when asking coding questions – admcfajn Commented Nov 24, 2020 at 22:09
  • 1 It's only WP-specific in that it's assuming the WP schema. Apart from that it's just a SQL question. – Rup Commented Nov 24, 2020 at 23:49
 |  Show 1 more comment

1 Answer 1

Reset to default 2

This is probably what you want:

update wp_users set user_email = lower(user_email) where user_email is not null;

However I'm surprised you need this: WordPress's default collation is case-insensitive.

发布评论

评论列表(0)

  1. 暂无评论