A very basic contact form in a shortcode. No-frills!

If you are looking for a standard contact form for your website, this could be for you. All it collects is the persons name, email and their message.

There’s also an optional spamblock as well as the option to change the spam question. I’ve released this in two forms, as a function for your functions.php file, or the same function wrapped up as a plugin. The plugin provides the option to change the spam question in the admin settings.

Here is the code for your functions file. The plugin version can be found near the end of this post.

The Code


You can also add the css below to your child theme stylesheet.


Simply use the [contactus] shortcode wherever you want the form in your page or post. You can also add it to a page template using the function call below.

<?php if (function_exists('mcf_render_contact_form')) mcf_render_contact_form(); ?>

Plug In

If all that code above scares the pants of you, you can also download a plugin version. The plugin makes changing the question and answer easy, if you plan on changing it regularly.

Simply upload this zip to your WordPress site and activate!