How To Redirect Contact Form 7 To Thank You Page

UPDATED 14-02-2019

We love using the WordPress plugin Contact Form 7 for the websites we build for our clients. It is extremely easy to use but very powerful and has reasonable documentation. A big plus for us is that it is a much loved plugin in the WordPress community and so answers and solutions can be found for almost all issues on sites like Stack Overflow and WordPress support.

At Storyteller Design we help out clients drive traffic to their sites through SEO and Google AdWords as well as the other search engine marketing like Bing Ads. One of the most important metrics for us is the conversion of these visitors to our client’s sites. A conversion is whenever someone completes a contact form, downloads a pdf or information sheet or calls the client.

Contact Form 7 How To Redirect To Thank You Page

We use Contact Form 7 for most of our contact forms and download forms. Once the form has been completed and the submit/download button clicked we want to redirect the visitor to a page where we can log that conversion in Google Analytics and pass that information back to our Google AdWords campaign.

Contact Form 7 used to suggest using an easy copy and paste technique to redirect to your thank you page.?However this method has been depreciated by Contact Form 7 and will no longer work after the end of 2017. This leaves two options.

Go to the “Contact” menu item in your WordPress back end side bar, click on the form you want to redirect and then click on the “Additional Settings” tab.

Add this code into the field provided:

on_sent_ok: "location = 'http://www.example.com/thank-you/';"

You need to replace the http://www.example.com/thank-you/ with the url of your thank you page.

 

  1. If you are not familiar with coding you can use a plugin called Contact Form 7 Redirection. They have both a free option available through WordPress but their Pro version adds some fantastic functionality that we often use for our clients.

Contact FOrm 7 Redirection

This plugin uses the “wpcf7_mail_sent” action hook to redirect to the thank you page, and this hook shouldn’t be depreciated soon. This plugin has been tested to WordPress version 5.0.3 so it will continue to work well for you. It requires Contact Form 7 version 4.8 or later.

We suggest you try this plugin first and if it doesn’t work then move onto the second option.

  1. Use some php in your child-themes functions.php file.

The method now recommended in the Contact Form 7 documentation is to use javascript to redirect when the wpcf7mailsent event occurs. The code to use is:

<script>
document.addEventListener( 'wpcf7mailsent', function( event ) {
    location = 'http://yourdomain.com/thank-you';
}, false );
</script>

If you only use one contact page, or only use on thank you page then all you need to do copy and paste the code below into your child theme’s function.php file.

//This function prints the JavaScript to the footer
function cf7_footer_script(){ ?>
 
<script>
document.addEventListener( 'wpcf7mailsent', function( event ) {
    location = 'http://yourdomain.com/thank-you';
}, false );
</script>
 
<?php } 
 
add_action('wp_footer', 'cf7_footer_script'); 

Again remember to replace the http://example.com/thank-you with your thank you page.

However we often use multiple contact form 7 forms on a website with multiple thank you pages. This is because we want to know exactly which pages, forms and calls to actions are converting our website visitors into leads so we send more traffic there, and optimise our conversion funnels.

In order to redirect different contact form 7 forms to different thank you pages you need to use the code below:

<?php
//This function prints the JavaScript to the footer
function cf7_footer_script(){ 

//if page name is contact.
if ( is_page('contact')) {?>
 
	<script>
	document.addEventListener( 'wpcf7mailsent', function( event ) {
			location = 'http://example.com/thank-you';
		}, false );
	</script>
 
<?php } 
	
}
add_action('wp_footer', 'cf7_footer_script');

Here is an example of the code for two different pages.

<?php

//This function prints the JavaScript to the footer
function cf7_footer_script(){ 

//if page name is contact.
if ( is_page('contact')) {?>
 
	<script>
	document.addEventListener( 'wpcf7mailsent', function( event ) {
			location = 'http://example.com/thank-you';
		}, false );
	</script>

<?php } else if ( is_page('download')) /* if page name is download */ {?>
 
	<script>
	document.addEventListener( 'wpcf7mailsent', function( event ) {
			location = 'http://example.com/thank-you';
		}, false );
	</script>
 
<?php } 
	
}
add_action('wp_footer', 'cf7_footer_script');

We hope this helps. It is important to note that this code will redirect all contact forms one a page to the same thank you page.

Please let us know if you have any questions in the comments below.

How to redirect contact form 7 to thank you page

WordPress White Screen Of Death

Oh No…My website has disappeared!

Don’t worry your website and all your content is probably still there, you might just be experiencing the white screen of death.

WordPress White Screen Of Death Marvin The MartianThe white screen of death is something many WordPress users have stumbled upon at least once. It is very frustrating as it locks you out of your site as well as the admin area of your website.

There is also no error message explaining what the problem is or giving a hint on how to fix it, so it looks like your website has just been vaporized by Marvin the Martian.

How will I know I am a victim of the screen of death?

You might see the white screen of death on specific posts and pages only or on the WordPress admin panel only whilst the rest of the functions are working perfectly. In this article we will show?you some of the?reasons why the white screen of death occurs?and how you might be able to fix it.

Because there are several reasons why this error might occur there is a lot of trouble shooting involved in order to correct this.

One of the biggest issues with the white screen of death is that because?you cannot access your admin panel to fix the problem it is difficult to solve unless you are comfortable working from the server side of your website and have access to it, through your website host.

Why it happens?

There are mainly 3 reasons why you get this error:

  1. You have exhausted your memory limit
  2. There is a problem in the code of your theme or one of your plugins
  3. A technical issue on?the web hosting server

Finding the reason for the problem

For you to find the root of the problem you need to examine where the white screen of death is showing first, it might show in?either one of these 3 ways.

  1. Multiple sites– if you see the error occurring in multiple sites, then your hosting provider is having some problems. If so contact your host and they might be able to tell you what the issue is.
  2. One of your sites– if the problem is occurring in one of your sites it may be a problem with the activated theme, or from the installed plugin.
  3. Specific pages or posts– if the error is showing on specific pages or posts then there is a problem with your specific site.

Rectifying the problem

Step 1.?Increasing the memory limit– There are 2 ways in Increasing the memory limit

  • Do it yourself- it is important to note that this process requires advanced knowledge of coding. You could try increasing your PHP memory limit by modifying the wp-config.php file. Simply add the following line:

? ? ? ? ? define(‘WP_MEMORY_LIMIT’, ’64M’);

  • Contact your host– ?This is the option we recommend, this kind of support is something your hosting company should be comfortable with. Just call them or send them an email and ask them to increase your memory limit. The problem with this option is that it may take a few hours to be put in place, and if it was not the issue then you are back to square one.

Because you cannot access the backend of your WordPress site you are probably going to need to access your server in order to carry out the following troubleshooting issues. To do this you will need:

FTP Server details:

  • FTP Address or Ip Address
  • FTP Username
  • FTP Password
  • FTP Client to access your server

Once you have accessed your server you will need to drill down into the wp-content/ folder of your website.

Another way to access this is to log into the cPanel provided to you by your host and find the file manager. This is an inbuilt server client where you can see the files and folders stored on your server. Your website files will usually be kept in a folder named public_html or www.

NB – Be very careful when navigating through your server. Any files you delete could permanently damage your website, so move forward with care, and if you are not sure of yourself seek professional help.

Step 2.?Disabling all the plugins– Find your main plugin folder that should be at the file path wp-content/plugins. Do not delete it, simply remake it so it can no longer be found by the WordPress system. I like to call it fluginsold.

Once you have done that go back to the hoe page of your website and refresh the screen using CNTRL – R. Does your website appear now?

If so one of your plugins are faulty. If you are still looking at a white screen, then your problem lies somewhere else.

Now go back into your server and rename your plugins folder back to “plugins”. You should still be able to log into the admin area of your WordPress site. If you go to the plugins section all of your plugins will now be deactivated.

This step becomes a bit tedious. You need to one by one reactivate each plugin and then check that your website is still working correctly and you do not have a white screen of death again.

If you get hit by another white screen of death you know that the plugin you previously activate is one of your problems.

Restart this process, by renaming the plugin folder again, and then undoing your name change. This time do not activate the plugin with the issue, but skip it and check the rest of your plugins. Sometimes you may have more than one plugin causing the problem.

If you really need the plugin that is causing the problem, try to delete it and then re download it. One of the causes of the white screen of death is if your plugin did not download completely.

If after renaming your plugin folder your website is still just showing the white screen of death then you need to try a similar process with your theme folder.

Step 3.?Replace current theme with a default theme–?if the plugin troubleshooting didn’t work then you should try replacing the activated theme with a default wordpress theme.?Before replacing the theme it is advised to back up your ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? current theme file, the best way to do this without access to your WordPress backend is probably through your hosts services.

This time rename your themes folder which you can find at wp-content/themes in your server folders.

Now check the front end of your site. Does your site appear now? If so then the theme you were using was causing the issue or was clashing with one of your plugins.

When you rename your themes folder back to themes, your default theme will have been activated. This is why it is always a good idea to have a default theme as a backup theme on your site but not activated on your site. We like to use the latest WordPress theme like twenty-seventeen.

Now you should be able to log back into the admin section of your website. Again maybe try to re download your theme to see if that is what caused the problem. Another possibility is that your theme is clashing with your plugins. In this case you need to choose which is more important to you.

Step 4.?Other fixes

  • If you did not find any problem through trouble shooting you should try to reinstall a fresh copy of WordPress, as the core file of WordPress might be corrupted.
  • You can also use the w/p debug function to see the root of the problem by adding the following code in your wp-config-php file. Once you add this the blank screen will have errors, warnings and notices, this way you will be able to see the root of the problem.

? ? ? ? ? ?error_reporting(E_ALL);
? ? ? ? ? ?ini_set(‘display_errors’, 1);
? ? ? ? ? define( ‘WP_DEBUG’, true);

  • Another successful trick is pasting the following code in your wp-config.php file. Or in some servers, you will be required to modify your PHP.INI file.

? ? ? ? ? 1./** Trick for long posts */
? ? ? ? ? 2.ini_set(‘pcre.recursion_limit’,20000000);
? ? ? ? ? 3.ini_set(‘pcre.backtrack_limit’,10000000);

We hope these solutions will be of value to you, if you have found other solutions feel free to let us know, we will be more than happy to hear?other ideas and add them to this post. If you have any questions or would like us to help you with your #whitescreenofdeath let us know on [email protected]

To follow along with us watch the video below:

Local Map SEO

How is local SEO different to traditional SEO?

Traditional SEO focuses on ranking websites whenever a certain keyword is used to direct the search. However local SEO try to rank a website whenever a keyword is used within a certain geographical area.

For example:

yourbusiness + city/area
yourservice + city/area

The geographical area can either be based on what was directly entered into the search bar or it can use the geographical location of the searcher themselves.

Any business with a physical location or that services customers within a specific geographical location absolutely needs to be using Local SEO.

It connects your business to people searching for your products and services in your area. Local searches are less competitive than international or national searches as there are less companies vying for the same space.

But how can I rank my website well for local SEO?

Search Engine Optimization is difficult because Google keeps changing the rules it uses to decide where to rank websites. Below you will find a quick summary of Google’s last few changes and how they changed the rules.

  1. Panda Update: Penalized Bad Content
  2. Penguin Update: Penalized Bad Links
  3. Hummingbird Update: Semantic Search – which means Google were trying to understand what the users are looking for rather than just the words in the search bar.
  4. Pigeon Update: Local Search ( July )

Googles’s Pigeon update is the update that most affected the local search results, which we are discussing. The update brought local search results more in line with traditional website ranking factors.

What changes came with the Pigeon update?

  • The geographical search radius shown was reduced.
  • Different search radius’s are also applied for different types of searches.
  • Favors directory websites. Look for our upcoming post on Barnacle SEO.
  • New local map pack – called “snack pack” with only 3 results instead of 7.

So what influences local search rankings and how have they changed?

Moz-2014-Local-Search-Ranking-Factors

The local search ranking factors have changed substantially in 2015.

Moz-2015-Local-Search-Ranking-Factors

On-Page Signals: ( down to 20.3% ):

1. Quality content is now more important than ever, it is more valuable to have fewer high quality posts rather than lots of average content going up on your website.?Once you have quality content then optimise it for your local targets.

Area to optimise:

  • City in the title tag
  • City in the H1 heading tag
  • City in content
  • City in image alt text
  • City in URL
  • City in metadescription

2. Embed Google Map from Google My Business not Google Maps.

3. NAP – Name, Address, Phone Number

4. Use a local phone number

5. Blog regularly

Link Signals ( Up to 20.03% ):

  1. Quality links are important, not just quantity.
  2. Local sites with high authority carry a lot of weight.

Citation Signals ( Down to 13.55% ):

Citations are mentions of your website and NAP on other websites and directories around the internet. The listings will usually include you name, address and phone number along with a link to your website.

  1. Make sure your citations are consistent.
  2. Get citations your competitors are not paying attention to.
  3. If you have ever moved or changed phone numbers? Then citation clean up is your number 1 priority.

Google My Business ( Up to 14.72% ):

  1. Claim your Google My Business (GMB) location.
  2. If you are having problems use phone support.
  3. Customers are 38% more likely to visit and 29% more likely to buy from a business that has a complete GMB profile and page.
  4. Optimise your GMB page:
    • Use a long description with formatting and links
    • Choose the correct categories
    • Upload lots of photos
    • Use a local phone number
    • Use your own profile and cover images.

Review Signals ( Down to 8.39% ):

88% of customers trust online reviews as much as reviews from friends and family.?People will decide not to buy from you if you have bad reviews. Definitely do not fake reviews, rather care about your customer and let their reviews shine through.

  1. Make it easy to leave reviews
  2. Don’t forget to ask for reviews.
  3. Set up a review page on your website domain.com/reviews ( Link this to your GMB page )
  4. Hand out post cards with a link to your reviews page.
  5. Follow up with emails asking for reviews.
  6. Google reviews are the most powerful.
  7. Have at least 10 reviews on Google before targeting 3rd party review sites.
  8. Most importantly have more reviews than your competitors.
  9. Reply to all your negative reviews.

Seem like a lot to take in and not sure where to start. The best place to start is with a local SEO audit of your site. Get one for free below.

Scan your website’s local SEO for FREE.

     

    If you have any questions please email us at [email protected] Information sources for this post include Moz.com and Greg Gillford’s Local SEO – A Seriously Awesome Blueprint.

    Local Map SEO

    Rocket-Launch SEO Speed Test

    Rocket-Launch SEO Speed Test

    The best way to test your website for its load time and how Google views it is to use Google’s own page speed insights. Since we want it to help us rank higher in the Google website and search rankings, it is important to take into account how Google views your load time, and what they think needs to be fixed or improved.

    To test your website using Google Page Insights.

    1.Click here and enter your website address or URL.

    2.Click Analyse

    3.Read through the results and see what needs to be changed or upgraded.

    Do not get scared if you find the results too technical for your understanding, send us an email at [email protected] along with your website address and we can test your websites speed and let you know what needs to be fixed and improved, what is critical and what should not be changed.

    What can slow?your page speed down?

    • Your host or server: As the saying goes, you usually get what you paid for. In the long run, a cheap hosting account can damage your page speed. Pick the right host best fits?your business size.
    • Large images: Images which are very large are?heavy to load and can really slow your website down. It is often due to extra data included in the comments or to a lack of compression.
    • External embedded media: External media like videos are highly valuable but can seriously?lower you load time. To gain some load time, host the videos on a sharing platform like youtube or vimeo.
    • Unoptimized browser, plugins and app: You should test your website on all browsers since they do not all load your website in the same way. Applications like Flash can also slow your site down considerably.
    • Too many ads: Besides irritating you visitors, ads can cost you page speed depending on how they are set up and how many you have.
    • Your theme: Some highly designed themes containing a lot of effects and fancy functionality can penalize your load time.
    • Widgets: Some social buttons or comment areas can have an impact of your page speed.
    • Double-barreled code: If your HTML/CSS is not efficient or too dense, it will lower?your page speed.

    Alternatives for testing your load time and your websites speed are:

    Pingdom?or Web Page Test

    It is always good to have a number of sources when trying to speed up our website.