All Collections
Customer Fields
FAQs & Troubleshooting
Common issue: Form redirect is not working
Common issue: Form redirect is not working

You may need to edit your Shopify settings or theme code to ensure that our form redirect settings are able to work properly

Kyle Weiskopf avatar
Written by Kyle Weiskopf
Updated over a week ago

Prevent theme from adding a return URL to the registration page

Depending on how your theme is coded, it is possible that using the account link in the site header will add a return URL which will prevent the form's redirect settings from functioning. If this is happening, it will cause the URL to look like the following when navigating to the login or register pages:

To resolve this, you will need to edit the code that is being used for the account link.

Edit theme code

The first step for this will be to locate the actual code for the header account link. This will most commonly be found in the header.liquid file in the theme code. It can vary depending on the theme, but there should be something that looks similar to the following:

{%- if shop.customer_accounts_enabled -%}
<a href="{{ routes.account_url }}" class="header__icon">
{% render 'icon-account' %}
</a>
{%- endif -%}

To resolve the problem here, we need to add an if statement to change the link based on if the customer is already logged in. You may need to tweak this to make everything match your theme's layout, but here is an example of the correct way this should look:

{%- if shop.customer_accounts_enabled -%}
<a href="{%- if customer -%}{{ routes.account_url }}{%- else -%}{{routes.account_login_url}}{%- endif -%}" class="header__icon ">
{% render 'icon-account' %}
</a>
{%- endif -%}

Make sure to save your changes, and always make sure to test on the storefront to make sure it works correctly now.

Disable Shopify's reCAPTCHA

Shopify has an additional layer of reCAPTCHA spam protection beyond what the Customer Fields app natively provides, and in certain cases we've noticed that this captcha is causing issues with form redirects.

The redirect problem typically occurs when Customer Fields attempts to automatically log a customer into their newly created account. In certain circumstances, Shopify will redirect customers to a "challenge" page with a checkbox captcha before the customer is logged in (URL for this page is /challenge). Unfortunately this challenge page completely overrides the app's redirect settings.

Ultimately Shopify's system controls how often each store's captcha is triggered, but luckily there is a way to disable Shopify's native captcha for certain parts of the storefront. If you are noticing issues with the redirect settings that have been configured in Customer Fields, then we suggest disabling Shopify's native captcha using the spam protection settings in the Shopify admin.

Spam protection settings in Shopify

You can manage the captcha settings for your store in the Shopify admin by going to Online Store > Preferences > Spam protection. On this page you can disable the setting for "Enable Google reCAPTCHA on login, create account and password recovery pages". See the screenshot below for an example of the setting in question:

Disabling the setting shown above will help to ensure that the redirects configured in Customer Fields will work properly.

Questions or concerns?

Please reach out to our Support team via chat or email if you need any assistance πŸ˜ƒ

Did this answer your question?