# Hide the Contact Form 7 Form After It Is Sent

> Hides the fields of a Contact Form 7 form once it has been sent successfully and leaves only the thank-you message, so people do not submit twice.

- Type: CSS
- Runs: Site-wide header
- Category: [Forms](https://wpide.com/library/category/forms/)
- Tags: contact-form-7, ux, css
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/cf7-hide-form-after-success/

## Code

```css
.wpcf7 form.sent > *:not(.wpcf7-response-output) {
    display: none;
}

.wpcf7 form.sent .wpcf7-response-output {
    margin: 0;
    padding: 1rem 1.25rem;
    font-size: 1.05em;
}
```

## Notes

Contact Form 7 adds the "sent" class to the form after a successful submission; reloading the page shows the form again.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Hide the Contact Form 7 Form After It Is Sent" in its snippet library and add it in one click; or create a new CSS snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
