Contact form 7 in popup window – WordPress Tutorial

Home » Old posts » Contact form 7 in popup window – WordPress Tutorial

Contact form 7 in popup window – WordPress Tutorial

In this short tutorial i will explain how you can have your WordPress contact form 7 show in a popup window.

Almost every website has some sort of call to action button or contact form. Having cool contact forms is always more productive and eye-catching. Placing your contact form in a right position is sometimes crucial for generating leads.

But what happens if you don’t have enough space to show your cool form? Is it worth it having it only on the “contact page” ?  The answer is NO.

You should have your call to action as eye-poking as you can. If you have trouble finding a perfect spot for that unique and fancy form  of yours, than putting it in popup window is a great solution.
notice * >>> It will work even if your form is not unique and fancy.

[quote]Hey i am not that good with jQuery. Is there an easy way to put my contact form in a popup window? [/quote]

Yes there is and ill be happy to share it with you, in return all you have to do is become a member of my religious chicken cult and give me all of your possessions ! I am not joking !!! read on.. 🙂

For the purpose of this tutorial we will need two wordpress plugins.

One of the favorite plugins for creating those cool forms in WordPress is ” Contact form 7

Contact form 7

You can download it here: Contact Form 7 Download

Its been downloaded more than 16.000.000 times to this date. If you however prefer some other plugin for your forms, that will work as well.

Second plugin that we need is called ” Easy fancy box “

easy fancy box

You can download it here: Easy Fancy Box

This one will take care of our jQuery problem.

Now lets put that form in that popup !

Once you have both of them plugins installed and activated, go on and create your form the usual way. Every plugin out there gives you some sort of

[shortcode] that you can insert inside your page or widget. That is all we need.

Once you have your form created you should have a shortcode that looks something like this

 [contact-form-7 id="2860" title="Contact form 1"]

Now you should wrap it up in the code below :

 <a class="fancybox" href="#contact_form_pop">Contact Us</a>
<div class="fancybox-hidden" style="display: none;">

<div id="contact_form_pop">[your own shortcode here]</div>


this is what you will get :

Contact Us

and that’s it, this will show a text link that will open up your contact form on click as a popup window, replace the shortcode and the text of the link to suit your needs.

Contact form in popup windows – Solved

If you liked this article say thanks by sharing it around, that makes me happy. Cheers.

Nikola fivera Petrovic
Get in Touch

Nikola fivera Petrovic

Hi there. My name is Nikola,
I speak English, Greek and Serbian.
As a Web Producer i can deal with almost anything web design & development related.

Web Design Skills

I have been into web design for the last 10+ years.
After working for various agencies and companies I have decided to take a lone wolf path as a Freelancer but I still actively collaborate with agencies across the globe.
I enjoy building websites on WordPress platform but i can work on any other platforms as well.

SEO Skills

I have spent a last couple of years as an SEO executive and SEO consultant working on 4 continents.
Specialized in on-page SEO I wear a pointy Google-Wizard White-Hat and help various small and medium-sized businesses rank well in the search engines.
I enjoy working with Google and Yahoo SE.
Feel free to request a free meeting bellow.
As a freelancer, I charge only a small portion of the money you would pay to agencies to get your project done.
Nikola fivera Petrovic
Get in Touch

Leave a Reply

81 Comments on "Contact form 7 in popup window – WordPress Tutorial"

Notify of
Sort by:   newest | oldest | most voted
Patrick Craig

How do I put this code inside a button? I’m using Avada theme.


Thanks, Solve the problem


Nice bit of code, but is there a way to make it work as a menu link? At the moment you have to click on a link to go to the page that contains the code, then click again.


How can I use a button, and put this code??????

Thanks for the tutorial. I just used it on twenty seventeen and it worked exactly as you specified. 🙂 I just have one little issue in that once it pops up with the contact form, the width of the contact form is slightly bigger than the content box, which causes it to have a scroll-bar at the bottom to see the whole width of the forms. I tried using the “size:” code as specified in… Read more »

Awesome thanks.


I have implemented all the steps, I am using a page builder element, ‘raw html’.

My problem is that the fancybox shows the actual shortcode text and not the form?

Any ideas as to why this is happening?


Had the same problem here!

Just change:


This fixes the error


Hi, I install the plugin called RD Hov Effect and inside that image description i put this code but unfortunately it displays only the shortcode not the form …… can u pls help …..


Thanks for this great tutorial! It works almost perfectly.
I have just one problem: when i click on the link, i get the error message “the image could not be loaded”. Does anyone know how to get rid of this?



thanks for this article but I just don’t get it – where am I supposed to insert the wrapper?

Thanks for any reply.


To autoclose after form sends, add this to Additional Settings

on_sent_ok: “parent.$.fancybox.close();”


Hi, where are those additional settings? I’d really like the autoclose to work.


In the form’s Additional Settings tab. It’ll be the last tab.


I’ve tried that but it doesn’t seem to be working. It won’t close. Additionally, I have several of those popups on the same page (for several people). But it only ever seems to open the same one even though I checked and double checked that the correct shortcodes have been entered/ What could be the reason for that?