Description
Safe Signup Form is a Wordpress Plugin that will forward a form submission to an email address, while preventing most automated attacks.
To do this it leverages Elliot Back’s WP Hashcash — an elegant anti-spam engine that uses javascript to determine if the form is submitted by a robot or a Web browser.
An administration page provides three options for handling submissions identified as spam:
- Delete spam submissions.
- Flag spam submissions (and forward them anyway).
- Forward without flagging.
The basic plugin offers a simple name and email form, but the php can be easily modified to incorporate any number of fields.
You can download Safe Signup Form here.
Safe Signup Form uses XHTML compliant code and has been tested in Wordpress 2.7 through 2.9.1, MSIE 7 and 8, Firefox 3 and 4, and Safari 3.
Installation
- Upload
ddf-signup.phpto thewp-content/pluginsdirectory of your Wordpress install. - Activate the plugin through the
Pluginsmenu in Wordpress. - View the
Secure Form - Signuppage underPluginsto set options for presentation, spam handling, validation, and other options. TheSecure Form - Signuppage also provides statistics on the number of spam vs. total submissions. - To add a form to a page either create a template with the php function:
<?php ddfs(); ?>or enter the shortcode[ddfs]in any post or page content.
IMPORTANT: If you are using WP Super Cache, changes you make using the Secure Form - Signup page may not appear. If this happens, edit and republish the page that presents the form.
Frequently asked questions
Q. I can’t get the form to send me an email.
A. The form should pick up the default admin email associated with your install of Wordpress. To change it go to the Safe Signup Form page under Plugins in the Wordpress Admin tool (you may need to log in as “admin”). You can then change the “forwarding email” value.
Since the forwarding email is generated by a script it may be blocked by your email server or filtered as junk mail by your email program. Check any spam or junk mail folders at the local and server level.
Q. Can I automatically forward an email confirmation to the user?
A. Not yet. I did not include automatic email confirmation because of the security implications — it allows a form to become a conduit for spamming third party addresses. The HashCash technology stops most robotic spam attacks, but human spammers could take advantage. I may add email confirmation as a option to a future version.
Q. Can I add additional fields?
A. The only way to add fields is to directly edit the plug-in PHP. If you know HTML and a little PHP this isn’t too difficult.
There are three places in the code where a new form field is defined or processed. First, in the ddfs_install() function its validation rule should be entered in the $options['error-rules'] array. Second, also in the ddfs_install() function, its label, if any, should be entered in the $options['forward-labels'] array. Finally, in the ddfs_form_display() function, the form markup must be entered in the $form array where the key matches that entered in ddfs_install().
Q. How do I change the appearance of the labels, fields and messages?
A. You can create the formatting you want by editing the “Custom Styles” option at the bottom of the Secure Form – Signup page. The default CSS is:
div.ddf label { padding-right: 0.5em; }
p.intro { font-style: italic; }
p.error { color: #ff0000; }
p.success { font-weight: bold; }
To stack labels over the fields, change div.ddf label to:
div.ddf label { display: block; }
To align fields to the right of the labels, you can try something like:
div.ddf label { display: block; float: left; width: 12em; }
Experiment with CSS and you should be able to get the format you like.
Have a question? Please use the comment form and I will do my best to respond.
Changelog
1.1
- Updated code to use localization (translation) functions for both admin and output.
- Corrected the “Error-spam flag” and “Error-spam cancel” fields to allow HTML tags.
- Added a “Compliant XHTML” admin option that places plugin javascript and CSS into the header of each page rather than into the body of the local page.
- Corrected a bug with the form action value that caused problems with calling the plugin from a template outside of The Loop
Upgrade Notice 1.1
This upgrade corrects several minor bugs and provides an option for compliant XHTML output. Use it if you want to call the plugin from a template outside of The Loop, desire XHTML compliance, want to format error messages, or want to localize the plugin.
Test the form
You can try out the form below. This is a dummy version and does not email to a live account. Try it with and without javascript enabled on your browser to see the spam response.
Please provide the information requested below. We will use your email only to communicate with you. We will not share it with anyone else for any reason.
Donate
Safe Signup Form is free, but any small donation is appreciated.

Hi. Integrated your form but it doesn’t send e-mail. Not sure what to check…
Posted by by Gene on May 4, 2009 at 5:59 pm