Notifications
Clear all

[Solved] How to disable change of email from wpforo account information edit?

2 Posts
2 Users
0 Reactions
143 Views
Posts: 4
Topic starter
(@sora9)
Active Member
Joined: 2 years ago

Hi,

My site does not allow change of email for security reasons and account information is managed through UM.

I have seen the past posts about this question, the solution provided is using the following CSS code to hide this section.

.wpf-field.wpf-field-type-email.wpf-field-name-user_email.wpf-field-required {
  display: none;
}

However, hiding section doesn't prevent user from changing email or other values. Any browser can quickly inspect the page and change hidden email value in a few seconds.

Is there any way to totally disable section from the front-end using other methods or through php snippet?

Thanks!

Topic Tags
1 Reply
Sofy
Posts: 4639
 Sofy
Admin
(@sofy)
Support Team
Joined: 7 years ago

Hi,

You can use JavaScript code provided below: 

jQuery( document ).ready(function() {
    jQuery('.wpf-field.wpf-field-type-email.wpf-field-name-user_email.wpf-field-required').remove();
});

For guidance on adding JavaScript to WordPress pages, you may find this article helpful: https://www.wpbeginner.com/wp-tutorials/how-to-easily-add-javascript-in-wordpress-pages-or-posts/