• Resolved Imagepassionsandplaces

    (@passionsadnplaces)


    I have a contact form on my site, and when people submit the form, this message pops up in a green box:

    It appears your submission was successful. Even though the server responded OK, it is possible the submission was not processed. Please contact the developer of this form processor to improve this message. Learn more

    It seems to only happen when the user is on mobile, not on desktop. Is there something we can do to prevent visitors to the site from seeing this message?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support ImageMilind More

    (@milindmore22)

    Hello @passionsadnplaces

    Thank you for reaching out to us, The message is sourcing from AMP plugin, As AMP pages are being served on mobile it’s likely that it only appears on mobile

    In a normal (non-AMP) site, when a user clicks “Submit,” the page usually refreshes. However, AMP requires forms to submit via “AJAX” (in the background without a refresh).

    The AMP plugin tries to “upgrade” your existing contact form to work this way. When the form is submitted, the server sends back a “200 OK” signal, but it doesn’t include a specific “Success Message” in a format that AMP understands. Because the plugin is “unsure” if the data actually reached its destination correctly, it shows that generic, cautious green box.

    How to fix it

    AMP handles redirects much better than “on-page” success messages.

    In your form settings (Contact Form 7, WPForms, etc.), set the form to Redirect to a new URL (e.g., yoursite.com/thank-you) upon successful submission.

    If you are a developer or have one, you need to modify the code that handles the form submission to send a specific JSON response. Instead of a generic success, the server needs to return a JSON object that includes a message.

    eg: As we are unsure which form plugin or form service you are using, I’m giving a generic response example

    if ( wp_is_json_request() ) {
        $message = __( 'Thank you! Your message has been sent.', 'text-domain' );
        wp_send_json( compact( 'message' ), 200 );
    }

    We hope this helps!

    Plugin Support ImageMilind More

    (@milindmore22)

    @passionsadnplaces

    As we didn’t receive a response I’ll mark this as resolved. Feel free to open a new support topic if you require any further assistance.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.