Writing a lightweight related content function for WordPress using tags to match content

Strangely, WordPress doesn’t ship with it’s own related content feature so there are a number available to download and use from the plugin directory. However, in my experience, most of these are quite resource-hungry, largely due to the fact that they build up the list of related content by string matching. This is a very expensive process and depending on the number of posts the script has to match against can lead to a slowdown in the database.

I’ve opted to write my own related content plugin using WordPress tags. Generally, a post should not have more than 5 tags attached to it. This makes the matching process much faster and less intensive on the database as tags are only ever matched against other tags attached to posts and never against the content of the posts themselves which could be lengthy.

Now this has the potential to get out of hand as tags can be easily entered by post authors leading to duplicates and unnecessary tagging which can then lead to poor relative matching. However, any professional organisation will have a publishing process and part of that should be for authors to avoid adding tags before checking if a suitable one already exists in the system.

View in Instagram ⇒

Setting up a canonical url filter to prevent search engines from indexing non-https site pages as secure resulting in the “Not secure” content flag in browsers which can negatively impact on brand reputation. This filter specifically targets the popular Yoast SEO plugin for WordPress

View in Instagram ⇒

Back to Angular today. If you’re learning Angular 2 and you’re developing on windows or in a corporate environment you’re likely to be hitting your head against a wall trying to get the angular cli module to install via npm. I suggest using the Cloud 9 (no affiliation) cloud IDE to develop your app as I’ve done – much easier and you’ll save yourself a lot of time

View in Instagram ⇒

Debugging pagination for a custom WordPress query – the “posts_per_page” value must match the value of “Blog pages show at most” under Settings > Reading, in the admin dashboard, else the last page in the pagination chain will break. If anyone knows how to programmatically avoid this issue drop it in a comment. Thanks

View in Instagram ⇒