4 Ways You Can Make Your Reps More Productive Today – Download Now

Show different excerpt length for different post types

If you have custom post types then there is a likelihood that you may want to show them on the same page but have different excerpt length for each of theme. Here is a simple snippet to help do this:

Replace “my-custompost-type1” with the slug of your custom post type. Obviously you can also add another if statement and adjust for other custom post types that you may have.

Contact forms and spam

One of the big issues on having a contact form on your website is the spam it attracts. Once your site gets listed on the radar for these spammers then there is simply no end to the endless stream of spam that will show up in your mailbox. There are 2 main ways to handle this:
1. Use a captcha/formula
These are the funny looking characters/numbers that are randomly generated so that bots cannot go through them. Equally irritating is the fact that humans too may have a tough time getting through these! A variation of these captcha is the formula based captcha where a basic algebraic equation is presented and the user is requested to compute the missing value.

2. Honeypot captcha
This relies on the weakness in spambots to just fill in fields that seem to be marked as mandatory but which are actually just a bait to know that the submission is coming from a bot. A human user would never see (or if using a text browser clearly see that the label for the field shows that it is for spammers only) this field and the system would be able to filter out if the submission is valid or not. This clearly seems to be a better solution and can be applied to both contact forms and comment forms in WordPress.

Choose any of the anti-spam methods that seems to work well for your situation – but do ensure that you have at least some mechanism in place.