I have an event template that pulls in a Freeform Pro field, via the Freeform Pro fieldtype, which relates a form to an entry. I'm having problems with a reoccurring error that says "Invalid form id(s)":

{exp:ce_cache:it id="events-{segment_2}-mobile_{gv_device_is_mobile}" tags="event"}



            {!-- This is my Freeform Pro Fieldtype https://www.solspace.com/docs/freeform/channel_entry_fieldtype/ --}


    {exp:stash:set name="content"}

                {if event_form}
                <div class="wb bt">
                    <div class="inner">



As you can see, I'm using Stash to set all of the data related to the entry and {stash:event_form} captures the Freeform Pro fieldtype. I'm also using CE Cache on the page, but i'm using CE Cache Escape tags {exp:ce_cache:escape} around the actual form.

I was wondering if someone can tell me if I need to be doing anything else to prevent this error? I can fix it temporarily by deleting the page from CE Cache, but eventually it reoccurs - presumably after someone completes a form on another entry.

  • 1
    Don't cache the form. You're already caching the output of channel:entries so there's no much to gain by further caching the page. These caching guidelines are for Stash, but apply to ce_cache too: github.com/croxton/Stash/wiki/Caching Commented May 12, 2015 at 16:43
  • Thanks Mark. Should I just remove the exp:ce_cache:it tags? Commented May 12, 2015 at 18:26
  • Or add the stash:nocache tag around event_form in exp:channel:entries? Commented May 12, 2015 at 18:33
  • 1
    I'd remove the cache:it tags. Commented May 14, 2015 at 12:48

1 Answer 1


We never recommend caching a form because it has a unique identifier from ExpressionEngine for CSRF protection that's generated per page as well as a unique identifier from Freeform used to prevent spamming, malicious form manipulation, and to assist in multipage forms.

You are getting the invalid form ID error because the cached form isn't able to regenerate the params ID Freeform needs to function properly.

  • Thank you. I guess I thought that using the escape tags would prevent this. Should I just remove the exp:ce_cache:it tags or take the event_form out of the stash set_list? Commented May 12, 2015 at 18:28
  • Since we're not familiar with Stash + CE Cached used together, we can't really say what is best practice here (lots of parse order and cache bending going on). Whatever you end up doing, the form's hidden csrf_token field value must not be cached for the form to work. Perhaps taking Stash out of the equation would work here though (i.e. just deal with cache and cache busting to the form part).
    – Solspace
    Commented May 14, 2015 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.