Minimal Contact Form Plugin for WordPress

There are many contact form plugins available for WordPress. These plugins tend to be highly configurable in order to produce complex forms. They typically require some effort to set up even for the simplest contact form and, invariably, they never produce exactly what I need because they cater to a large user base with infinite data collection needs. I wanted a minimal contact form that allows a user to complete a basic, four field form in order to submit a message through the website with no set up involved.

The Minimal Contact Form plugin produces a simple form to capture Name, Email, Subject, and Message fields. When the user submits the form, the input is sent to the WordPress defined Admin email address. The look and feel of the form can be changed through your child theme’s style sheet, but it isn’t a mandatory step.

Once the plugin is installed and activated, the shortcode “mcf_contact” is used to display the form on the desired page.

Minimal Contact Form Plugin Code

Plugin to Remove WordPress Version Number From Meta Info

For security reasons, especially if you are running an older version of WordPress, you may want to hide the automatically added WordPress version number that shows up in your site’s source code and RSS feeds. This plugin will prevent the version number from being added to the generated pages. Add the below code to a .php file and upload it to your plugin directory. Once uploaded, activate the plugin from your dashboard and the WordPress version number will not appear.

WordPress Plugin to Block Spam Comments

I don’t receive many real comments from actual humans on my posts, but I do receive a lot of annoying spam comments each day. It’s a nuisance to regularly empty the spam folder, but I prefer to leave the option to post comments open for the rare occasion when someone has a follow-up question or comment. There are many WordPress plugins available to block spam, however, they are typically overkill for a small site like mine. I wrote this plugin to provide a simpler solution to block the majority of spam comments. It is not meant to block every possible method that spammers have for generating comments, but it will block the vast majority. The intent was also to avoid employing user obstacles such as CAPTCHAs and other challenge-response tests.

I’ve had this plugin running on my site for several months and I have not had any spam comments.

Add the below code to a .php file and upload it to your plugin directory. Once uploaded, activate the plugin from your dashboard and it will begin blocking spam comments for your site.

The plugin uses three methods to filter spam comments:

  • Timestamp Method: If a comment is submitted in less than 15 seconds after viewing the page or after more than an hour, then the comment will be rejected as spam. The time thresholds should be adjusted to meet your individual needs. I’ve noticed that most spam comments are submitted within 5 seconds after viewing the page.
  • Honeypot Method: Many automated tools for generating spam comments will blindly add data to every available field in a form. The honeypot method adds a non-visible field to the comment form that will cause a comment to be rejected as spam if any information is submitted in the field.
  • Link Counter Method: If a comment includes 2 or more URLs in the comment body, then the comment will be rejected as spam. The number of allowed URLs in a comment should be adjusted to meet your individual needs. Spam comments generally have multiple URLs included in the comment body.