Blog

Get reCAPTCHA on your ClassiPress Single Ad Contact Form

Tested on WordPress 3.6.1  &  ClassiPress Version: 3.3.1

Did your customers ever complain about email spam comming from your ClassiPress site? Let’s try to make it a bit more difficult for the spammers. In this tutorial we will replace the simple math question under the description with a reCAPTCHA. Of course we don’t touch the core files! We do all our changes in a child theme.

Check the demo site

I assume that you have WordPress Classified Ads Theme and your own child theme running. Time to get started:

Step 1

Create a reCAPTCHA key on the Google reCAPTCHA site. To do so, just enter your domain on that site and let Google create you a key. The result will be this:

recaptcha-demo

Open your ClassiPress admin area, => ClassiPress => Settings => Security (tab) and set the keys in your reCaptcha Settings. Enable reCAPTCHA and save the settings.

Step 2

Now we need to copy a core file and place it in our child theme folder. I’m talking about the /themes/classipress/includes/sidebar-contact.php. Create a /includes folder in your child themes folder (so it looks like this: /themes/your-childtheme/includes/) and upload a copy of that sidebar-contact.php file into that /includes folder. So now you have this: /themes/your-childtheme/includes/sidebar-contact.php

Now open your /themes/your-childtheme/includes/sidebar-contact.php with your editor and find this part of code (around line 13):

Replace the above code with this one:

please-read

Dear visitor. Get reCAPTCHA on your ClassiPress Single Ad Contact Form is a premium article. If you would like to get access to the rest of this article, please pay $ 3.45 USD fee to help me keeping this site alive. After your payment is done you will automatically receive an Email that includes an activation link. Please Note: The activation link is valid for 2 days.

Tags: , , , ,

11 Responses to “Get reCAPTCHA on your ClassiPress Single Ad Contact Form”

  1. steely July 30, 2013 at 06:31 #

    I took this one for a spin Samcy but it didnt work for me,

  2. steely July 30, 2013 at 06:37 #

    actually it works perfect. I was missing one step and that was adding the includes file to child theme. This is the second tut that has been suppppppper awesome from samcy

    cheers

    • Rolf Hassel July 30, 2013 at 06:40 #

      Glad to see that it works for you.

      Cheers

  3. steely July 31, 2013 at 05:33 #

    may i ask a slight unrelated question please?

    So I have the captcha for the classipress setup in the settings are and now with this mod in the contact sidebar area.

    I have a contact form which I need to download the real simple captcha for but since it is already being used 2 times in my site I figured its already there.

    Can you please direct me how to link my contact form 7 captcha to become functional using the same classipress already built in captcha so I do not add another unecessary plugin to the site?

    Please and thank you samcy

  4. Rolf Hassel July 31, 2013 at 10:56 #

    So far i haven’t yet looked into the contact form 7.

  5. Pascal November 14, 2013 at 02:21 #

    HI!

    I have done this tutorial:
    “Redirect your visitors to a THANK YOU page after using the contact form sidebar ClassiPress”

    I modified the functions.php file as requested and it worked (except that now I always say that the calculation of safety is wrong! But I already wrote in the post for this problem).

    Now I have started doing this tutorial.
    In functions.php I pasted the code that was here but at the moment to save the entire screen has turned white.
    Then I tried to delete the code that I put in the functions.php from the tutorial of “Redirect ….” and just to put this new tutorial.
    Result: the sidebar of contact no longer loads.

    Then I put the old code of the first tutorial and the sidebar is loaded but still the calculation of safety does not work.

    I hope to hear from you soon.

    regards,
    Pascal

  6. Mike December 28, 2013 at 00:50 #

    this is the code im getting in the message area:

    Parse error: syntax error, unexpected T_ENDIF in /home/content/31/12093631/html/wp-content/themes/classipress-childtheme/includes/sidebar-contact.php on line 79

    did step by step any thoughts or suggestions?

  7. Devil April 22, 2014 at 21:58 #

    Hi,
    I have the same identically problems… with the first mod (redirect after send a msg) work except for the original captcha calculator (i put a wrong result but the msg sent)… for this reason I have buyed this tutorial to make a new captcha sistem but now my sidebar_contact is empty like it dont loaded!

    Any help?

  8. Rolf Hassel April 27, 2014 at 08:30 #

    You are right. This is caused when both modifications are done.

    Please try this when you are using the article for the reCaptcha:

    When you edit the sidebar-contact.php leave the following part at the end away. This one here:

    < ?php endif; ?>

    After you removed that line, save that file.

    Now do not place anything into the functions.php as this is already done by the other modification (redirect users…)

    Continue with step 4 (style.css)

    That should solve the problem.

    Cheers

  9. Seb June 15, 2014 at 09:15 #

    Hi,

    My reCaptcha shows only 1 word (instead of 2) : http://www.2roo.com/annonces/vendre-800-marauder/

    Could you tell me what’s wrong?

    Thanks.

    • Rolf Hassel June 15, 2014 at 09:36 #

      You can not do anything about that. Google decides if people get asked for one or two words, or numbers. It’s random.

Leave a Reply


+ 4 = 5

Go Up ▲Go Up ▲