This email address does not belong to the same domain as the site

WordPress Optimization by RankYa

This email address does not belong to the same domain as the site. error message shown in WordPress Contact Form 7 is not an error

Here’s What This Message Means

It means that the email address you are using for contact form 7 to receive your emails is different to your domain name.

For example: if I am using Contact Form 7 on rankya.com domain, and then provide email address to receive my emails using another domain (as shown in figure below)

shows This email address does not belong to the same domain as the site error message
shows This email address does not belong to the same domain as the site error message from Contact Form 7 User Interface

Where is the file that Generates this Error Message?

The file is within WordPress plugin folder

  • contact-form-7/includes/config-validator.php

It uses a function and PHP switch condition


public function get_error_message( $section ) {
$code = $this->get_error( $section );
switch ( $code ) {
case self::error_maybe_empty:
return __( "This field can be empty depending on user input.", 'contact-form-7' );
case self::error_invalid_syntax:
return __( "This field has syntax errors.", 'contact-form-7' );
case self::error_email_not_in_site_domain:
return __( "This email address does not belong to the same domain as the site.", 'contact-form-7' );
case self::error_html_in_message:
return __( "HTML tags are not allowed in a message.", 'contact-form-7' );
default:
return '';
}
}

How to Fix ‘This email address does not belong to the same domain as the site’ Error Message

Login to your WordPress Dashboard > Plugins > Editor > Select plugin to edit: Contact Form 7 > contact-form-7/includes/config-validator.php

Just comment out using 2 forward slashes as highlighted below
public function get_error_message( $section ) {
$code = $this->get_error( $section );
switch ( $code ) {
case self::error_maybe_empty:
return __( "This field can be empty depending on user input.", 'contact-form-7' );
case self::error_invalid_syntax:
return __( "This field has syntax errors.", 'contact-form-7' );
//case self::error_email_not_in_site_domain:
//return __( "This email address does not belong to the same domain as the site.", 'contact-form-7' );
case self::error_html_in_message:
return __( "HTML tags are not allowed in a message.", 'contact-form-7' );
default:
return '';
}
}

Did following this insight fix the error message?

72 / 259 Malvern Rd Melbourne Australia 3141

+61421600702 $$

Author: RankYa

RankYa: Online Entrepreneur, Web Developer, Google AdWords and Google Analytics Certified Professional. Specialist in: Structured Data, Microdata, Microformats, RDF, Schema.org Vocabulary, HTML5, WordPress optimization, Advanced Image Optimization, Google Webmaster Tools, Social Media Marketing, Facebook marketing and YouTube video ranking mastery. Check out the latest 2017 Online Marketing course. View all posts by

Have Your Say! Comment

Your email address will not be published. Required fields are marked *