วัน: 5 ตุลาคม 2005

How to Replace ‘อีเมล’ or ‘อีเมล์’ in WordPress with MariaDB According to the Royal Society of ThailandHow to Replace ‘อีเมล’ or ‘อีเมล์’ in WordPress with MariaDB According to the Royal Society of Thailand

The Royal Society of Thailand has specified that the correct spelling for ‘e-mail’ is ‘อีเมล’ (without the ‘ล์’), adhering to the English language substitution guidelines where ‘l’ is used only once. The alternative spelling ‘อีเมล์’ (with the ‘ล์’) is commonly used for comparison with the word ‘เมล’ (mail truck), but it does not align with the actual pronunciation of the original term. Therefore, it is recommended to use ‘อีเมล’ for linguistic standardization.


Given the frequent use of this term, manually editing each article to replace it would be time-consuming. Therefore, using the REPLACE function in MariaDB to update the WordPress database is a more efficient approach.

SQL

SQL

UPDATE wp_posts SET post_content = REPLACE(post_content, 'อีเมล์', 'อีเมล') WHERE post_content LIKE '%อีเมล์%';

This SQL command will search for all occurrences of ‘อีเมล์’ in the ‘post_content’ field of the ‘wp_posts’ table and replace them with ‘อีเมล’.

Conclusion

By utilizing the REPLACE function in MariaDB, WordPress users can efficiently update their databases to align with the Royal Society of Thailand’s linguistic guidelines. This method ensures consistency and accuracy in the use of the term ‘อีเมล’ across all articles.