Before And After: Lead Capture Plugin For WordPress


Before & After is a lead capture plugin for WordPress. It allows a webmaster to require visitors to complete a goal, such as filling out a contact form, before viewing the contents of a page or downloading a file.

The plugin automatically tracks which visitors have completed your goals, and shows the appropriate content to each visitor. For example, it can show a form to visitors until they have completed the form, at which point they will be given a link to download a special file or whitepaper.

Before & After can be used with any plugin that uses shortcodes, but works especially well with Contact Form 7 and Gravity Forms.

Protect Pages with Goals

With Before & After, you can require your visitors to complete one of your Goals before viewing a given page. This functionality is especially useful when you want to ensure visitors read a Terms Of Service, Copyright Notice, or other important message before viewing a given page or bit of content.

Once you’ve installed Before & After, simply edit the Page or Post in WordPress, and then use the Before & After meta box to configure Page Protection.

More Information on Page Protection

Create Lead Capture Forms with Contact Form 7, Gravity Forms, or Your Favorite Forms Plugin!

Before & After Pro integrates directly with Gravity Forms and Contact Form 7. Any forms you create in Contact Form 7 (CF7) or Gravity Forms will be available in Before & After, to create lead capture forms!

Not using Contact Form 7 or Gravity Forms? That’s OK – Before & After can create Lead Capture forms with any forms plugin.

Check out our documentation instructions for more information.

One Plugin, Tons of Uses

Using this simple plugin, any number of scenarios are possible:

  • Lead Capture Forms: Ask a visitor to signup for your newsletter in return for a free download, special report, or whitepaper.

  • Protected Downloads: Ask visitors to complete a form or other Goal before downloading your file. If they share the link, the recipient will have to complete the form as well.

  • Protected Content: Use Before & After to hide content from users until they have completed your form, or another goal. Hidden content will only be visible to those who have already completed your Goal.

  • Terms Of Service Pages: Make sure a visitor reads the terms of service first. Once they have read the TOS once, they may view any other page.

  • Age Gates: Make the visitor confirm their age before browsing a given page.

  • Copyright Notices: Inform visitors of the copyright of a particular piece of content before allowing them to view it.

  • Instructions In Series: Make sure that a visitor reads a series of instructions in sequence. If they land on a later page, ask them to start over.

  • Guided Product Tours: Show your users the screens of your product in a sequenced progression.

  • HubSpot Tracking: Capture lead data and send it to HubSpot (requires Pro).

There are many other possibilities. By offering WordPress webmasters a simple way to gate content we hope to provide a useful tool for many scenarios.

Upgrade to Pro for For Advanced Features and Support

The GoldPlugins team does not provide direct support for the Before & After plugin on the forums. One on one email support is available to people who have purchased Before & After Pro only. Before & After Pro also includes conversion tracking, email notifications, submitting data to HubSpot, and other advanced features. You should upgrade today!

Upgrade To Before & After Pro


  • This is the list of Goals.
  • This is the Add New Goal page.
  • This is the Conversion Tracking Log.
  • This is the Settings screen.
  • This is the Help screen.


Dieses Plugin unterstützt 2 Blöcke.



In diesem Abschnitt wird beschrieben, wie du das Plugin installieren kannst und wie es arbeitet.

  1. Upload the contents of /before-and-after/ to the /wp-content/plugins/ directory
  2. Activate the Before And After Lead Capture Plugin through the ‚Plugins‘ menu in WordPress
  3. Read the Instructions.

Introduction: How Does This Plugin Work?

Before & After is a lead capture plugin that lets you offer your users something in exchange for their information. It can also be when you need to make sure your users read your Terms of Service, verify their age before entering your website, or otherwise need to see one thing, and then another.

To achieve this, Before & After uses what we call goals. A goal is simply an action, or a „gate“, that your users need to pass before they will be allowed to see your protected content.

A user completes a Goal by simply encountering the [complete_goal] shortcode. You will have placed it on your Thank You page, on the terms page, or whatever other page you need the user to view to signify that they have completed the goal.

How To Setup A New Goal

To create a new Goal, simply follow these steps:
1. Under the Before & After menu, select Goals. This will bring up a page which lists all of your goals.
2. Click the „Add A New Goal“ button
3. Give your Goal a title, and then fill out the Before & After sections. When you are done, click the Publish button.
4. Your goal has been created! Copy the [goal] shortcode from the Edit Goal screen you are currently viewing, and go paste it onto the on which page you’d like the goal to appear.

How To Have A Visitor Complete A Goal

Simply add a shortcode like this to the final step of your goal funnel. For example, you could place it on the „Thank You“ page from a contact form.

[complete_goal id="82"]

(Replace the number 82 with the id of your goal. Tip: you can find the shortcode for each goal on the Goals page.)

Shortcode Reference

Goal Shortcode

Add this shortcode to any page or post to display your goal there.

[goal id="82"]

Complete Goal Shortcode

Add this shortcode to the page which signifies that a visitor has completed the goal. For example, you could put this on a „Thank You For Contacting Us“ page.

[complete_goal id="82"]

Integrating with Contact Form 7

If you have the Contact Form 7 plugin installed, you’ll be able to select any Contact Form 7 form as the Before option for your Goals. Simply Add a new Goal or edit an existing one, and you’ll see your Contact Form 7 forms listed.
Important: be sure to redirect your Contact Form 7 form to a thank you page, and to add the complete goal shortcode to the Thank You page. Refer to these instructions if you are unsure how to do this.

Integrating with Gravity Forms

If you have the Gravity Forms plugin installed, you’ll be able to select any Gravity Form you have created as the Before option for your Goals. Simply Add a new Goal or edit an existing one, and you’ll see your Gravity Forms forms listed.
Important: be sure to redirect your Gravity Form to a thank you page, and to add the complete goal shortcode to the Thank You page. Refer to these instructions if you are unsure how to do this.

How to Submit My Data to HubSpot

If you have Before & After Pro installed, and you have an active HubSpot account, you can have submission data from your Goals submitted through to HubSpot. To do so, first login to your HubSpot account and create a new Form to receive our submissions. Next, simply visit our Settings page and look for HubSpot settings. Once here, you’ll want to add your HUB ID, the GUID of the Form (on HubSpot) that you want to send data to, and (optionally) input the Titles of any forms that you don’t want to send to HubSpot. This feature will only work on Contact Form 7 or Gravity Forms that are associated with a Goal.

Before & After will attempt to map your fields to HubSpot — to adjust the field mapping array use the ba_hubspot_field_mappings filter.

Before & After will block some default Gravity Forms fields from being sent to HubSpot — to adjust the field mapping array used for blocking, use the ba_gform_default_fields filter.


How Do I Get Started?

After installing the plugin, visit the Goals -> Add New menu to create your first Goal.

How can I see the Before stage of my Goal again, now that I’ve completed it?

Visit the Before & After -> Settings menu, and then choose the Reset Goals tab. Then click the Reset Goals button. You will now see the Before stage again for all of your goals.

Where Can I Find The Settings Page?

Look for the Before & After menu in WordPress, and then choose the Settings submenu.

My goals work when I am logged in, but not when I am logged out. What could be happening?

You are most likely experiencing a caching issue. Try excluding the URL with your Goal from your caching plugin’s settings, or temporarily disable your caching plugin, and see if this resolves the issue.

WP Engine Users: You’ll want to contact support, and ask them to exclude your pages from the cache.

Is there a Pro version available?

Yes! Before and After is an entirely lead capture free plugin, but has a Pro plugin which upgrades it with advanced features such as conversion tracking and notifications. It also includes email-based technical support.

Click Here To Learn More About Before and After Pro.

View More FAQs


12. November 2018
Currently redirecting to a thank-you page after form is filled out (contact form 7) results in endlessly redirecting users to the thank-you page. User has to manually clear out a 30-day cookie. No sure what value I'd gain from this. The cookie is fine for ensuring users don't have to fill out the form again, but having to clear the cookie to navigate the site is absurd. Also, lack of support/documentation for its features makes it difficult to give this plugin any more than 1 star. Create better walk-throughs and examples of your plugin so that those who use it don't have to wait endlessly for the plugin authors to respond to an issue. Added an issue to the plugin's support and no response after 3 days.
13. März 2018
I wanted to capture name and phone number before showing certain content. I selected a contact form from the "Before" drop down and in the Äfter" section, I selected "Show Text". What I liked most was - I was able to post shortcode in the text. Thanks a lot for this plugin. Helped me a lot!
7. Dezember 2017
Thank you for creating this plugin. Its very simple to use and works perfect. I was using a much more complicated setup before (Email before download, which is not available anymore) But Before and After is the allround solution, very nicely made.
10. Januar 2017
I was looking for a plug-in for what we call "Gated Content": The website visitor has to fill in a form with some personal information before he or she is able to download a PDF document. Since this is very common in B2B marketing I expected a wide range of plug-ins, but I found very few options. The first plug-in I found was "Email Download Link". It's very efficient to set it up, and it sends a download link to the visitor by email, so the email address gets kind of verified. But it asks only for name and email which is too little information in the B2B environment where you need at least a company name and preferrably fields like department, position or phone number. This is the big advantage of "Before And After": Since it integrates with two very popular form plug-ins you can ask for any information you like. The biggest disadvantage on the other hand is the fact that the download link is not encoded. If someone shares or publishes this link, then your content gate is useless. To avoid this you need to send the download document as an email attachment, but then you don't need "Before And After" at all. There are some usability issues in the backend as well, and the paid version is advertised quite obstrusively.
Lies alle 13 Rezensionen

Mitwirkende & Entwickler

„Before And After: Lead Capture Plugin For WordPress“ ist Open-Source-Software. Folgende Menschen haben an diesem Plugin mitgewirkt:




  • Compatibility with WP 5.2.1
  • Minor updates.


  • Compatibility with WP 5.1.1
  • Minor fixes.


  • Minor fixes.


  • Adds Form Builder! Create your own forms inside Before & After.


  • Minor fixes


  • Simplified interface for the Add and Edit Goal Screen with improved instructions.
  • Minor fixes


  • Minor update


  • Adds Gutenberg blocks for Goal and Complete Goal.
  • Compatibility update for WP 5.0


  • Prevent Page Protection from redirecting users on anything other than single Pages or Posts


  • Compatibility with Contact Form 7 version 5.0 (fixes issue with pages not reloading automatically on form submit)
  • Compatibility with WordPress version 4.9.4


  • Improves persistence for goal completion across browser sessions.


  • Automatic file type detection for protected downloads.


  • MAJOR UPGRADE! Please backup site before proceeding.
  • Admin UI update.
  • Under the hood improvements.


  • Update Protected Download file delivery to allow redirects.

View Changelog