Categories
WordPress

Enabling Form Validation on WordPress Comments

For over a decade, The Cerulean Standard has accumulated comments from a wide variety of people — many who have posted confidently using their real name and what seem like valid email addresses while others have chosen anonymity with pseudonyms and pretty obviously fake email addresses.

The websites entered with the comments have been just as varied — from links to personal sites that match the rest of the information given (name, email address) to links to Google to strings which don’t resemble a valid website address at all. You know what I mean: “none,” “http://no,” “na,” and so on. Users for whatever reason don’t want to leave the field empty (even though it isn’t required), so they put in some invalid data if they don’t have a website. 

Categories
WordPress

How to Add Whimsical Form Field Placeholders to WordPress Comment Forms

The WordPress comment form is a humble little thing: a few form fields, an explanation or two, and not much else, barring any plugins or customizations, that is.

Users who have left comments already will be greeted with a form that is already filled out the next time they visit, thanks to a cookie which WordPress sets, but what about before their first comment?

Would-be commenters are greeted by empty form fields for their name, email address, and website address, which is straightforward enough, but what if you want to jazz things up ever so slightly by adding some placeholder text to these form fields? 

Categories
WordPress

How to Avoid Losing Visitors Due to Comment Links

Note: The code in this article was updated and tested to work as of 2015-09-01.

If you run a WordPress-powered website, ask yourself, how many users leave your site by following the links left by commenters? The answer will no doubt vary greatly site to site, but if your users are leaving your site prematurely and forgetting to come back, then you need to improve that situation straightaway.

And it’s easy to do! What we’ll do is add a small snippet of code to your site which will alter the links to instead open in a new tab (or window, if tabs are unavailable), ensuring your site remains open in the user’s browser. Links which point to the current site’s address (as determined by home_url() will not open a new tab).