Trigger {% if form.posted_successfully? %} with URL

Topic summary

A developer is trying to trigger Shopify’s {% if form.posted_successfully? %} conditional for the password recovery form using URL parameters during theme development. They want to test success messages without hitting rate limits.

What works:

  • Contact forms can be triggered via ?contact_posted=true URL parameter
  • Customer subscription forms respond to ?customer_posted=true

The problem:

  • No equivalent URL parameter found for recover_customer_password form
  • The “too many attempts” security limitation cannot be bypassed via URL parameters (this is a Shopify security feature)

Additional issue identified:
When any form submits on a page, it triggers all form.posted_successfully conditionals regardless of form type. This affects pages with multiple forms (e.g., contact form + newsletter subscription), causing unintended success messages to display simultaneously. Multiple theme developers have confirmed this as a known issue.

Status: The original question about password recovery form URL triggering remains unresolved. The conversation evolved to reveal a broader limitation with Shopify’s form success handling.

Summarized with AI on November 15. AI used: claude-sonnet-4-5-20250929.

Via StackOverflow, I saw that {% if form.posted_successfully? %} can be triggered by adding a GET attribute to the URL. For example, ?contact_posted=true will trigger the contact form, and ?customer_posted=true will trigger the newsletter subscription form. Is it possible to do the same for the password recovery form? I’ve tried using **?**recover_customer_password=true, but no luck. Is there any official documentation in regards to this?

1 Like

Hi @BigSkillet ,

You can use this condition for all forms:

{% if form.posted_successfully? %}
Comment posted successfully!
{% endif %}

So instead of each form being different like the code you mentioned you would use this condition for all.

Refer https://shopify.dev/api/liquid/objects/form#form-posted_successfully

Hope it helps!

Yes, I understand the conditional can be used for all forms. The question is – how to manually trigger the success message for development purposes, specifically {% form ‘recover_customer_password’ %}.

Hi @BigSkillet ,

‘development purposes’: What does it mean?

You can still use it for {% form ‘recover_customer_password’ %}. Refer https://github.com/Shopify/dawn/blob/main/templates/customers/login.liquid

Hope it helps!

When I said “development purposes,” I meant that I’m developing a custom theme and would like to test the success message without running into a “too many attempts” issue. This can be done with a contact form by adding a ?contact_posted=true attribute to the browser URL. I’d like to know if there’s a similar attribute that can be added to test a recover password message.

Hi @BigSkillet ,

With the contact form, this is only to confirm you have submitted successfully, it is not intended to block ‘“too many attempts”’.

So if you want to check the successful submission of ‘recover_customer_password’ form, you can follow my instructions or refer to Dawn theme’s code.

You can’t block the “too many attempts” message, it’s Shopify security.

Or you can contact Shopify for detailed explanation.

Hope it helps!

Does anyone have an answer for this? I would like to have multiple different contact forms on the same page but whenever any of them is submitted, contact_posted=true triggers all of them to show the success message.

Submitting a form will trigger all instances of form.posted_successfully on the page, regardless of what type of form they are. For example, on the Dawn contact page, if you submit the contact form, it will also trigger the newsletter subscribe below. I’ve talked to several theme developers about this and it’s a known issue.

1 Like