Body: <p>I'm running CiviCRM 5.53 on a Wordpress 6 site.</p>
  <p>I have a Civi contribution page set up to be a membership form. The profile used on the form is configured to use reCaptcha, and the reCaptcha is correctly configured with an API key etc.</p>
  <p>With the form injected into a Wordpress page using a shortcode, which is my preferred option, the reCaptcha is not displayed and the form consequently generates an error when the user tries to submit the form. Of course as the user can't see the reCaptcha they can't complete it, and so the form can't be submitted.</p>
  <p>If I view the Contribution page - <a href="https://mysite.tld/civicrm/contribute/transact/?reset=1&amp;id=5" rel="nofollow noreferrer">https://mysite.tld/civicrm/contribute/transact/?reset=1&amp;id=5</a> - as an unauthenticated user then I can see and respond to the reCaptcha.</p>
  <p>This is a recently introduced issue, as this site has been running flawlessly for several years. I'm assuming that it has arisen as a consequence of recent Civi and/or Wordpress updates.</p>
  <p>Looking at the browser console, the shortcode version of the form shows a series of errors of the type:</p>
  <p><code>Syntax error: Unexpected token '&lt;'</code></p>
  <p>which are not present in the console for the contribution page.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-10-13T10:58:17.483Z
Comments.Text: Can you have a look at your PHP and CiviCRM logs and add any errors you find there?
Comments.UserDisplayName: Christian Wach
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-08-21T05:00:56.270Z
Comments.Text: are you using v2 or v3 recaptcha?
Comments.UserDisplayName: petednz - fuzion
Tags: <wordpress><recaptcha>
Title: Recaptcha not displayed on contribution page when using WP shortcode
ThreadText: # Recaptcha not displayed on contribution page when using WP shortcode
  
  (Asked by: username_0 on 2022-10-07)
  
  I'm running CiviCRM 5.53 on a Wordpress 6 site.
  
  I have a Civi contribution page set up to be a membership form. The profile used on the form is configured to use reCaptcha, and the reCaptcha is correctly configured with an API key etc.
  
  With the form injected into a Wordpress page using a shortcode, which is my preferred option, the reCaptcha is not displayed and the form consequently generates an error when the user tries to submit the form. Of course as the user can't see the reCaptcha they can't complete it, and so the form can't be submitted.
  
  If I view the Contribution page - <https://mysite.tld/civicrm/contribute/transact/?reset=1&id=5> - as an unauthenticated user then I can see and respond to the reCaptcha.
  
  This is a recently introduced issue, as this site has been running flawlessly for several years. I'm assuming that it has arisen as a consequence of recent Civi and/or Wordpress updates.
  
  Looking at the browser console, the shortcode version of the form shows a series of errors of the type:
  
  `Syntax error: Unexpected token '<'`
  
  which are not present in the console for the contribution page.
  
  **Tags:** wordpress, recaptcha
  
  > **Comments:**
  > **username_1**: Can you have a look at your PHP and CiviCRM logs and add any errors you find there?  
  > **username_2**: are you using v2 or v3 recaptcha?  
  
  ---
  
  ## 0 answers
  
  