Category: Wordpress

Extend Yoast Schema with a New Type

Yoast 11 introduced schema data added by default. If your site already has schema added through your theme then this may break. At the time of writing, the documentation only shows how to extend an existing type (Person), not add a new one. So here I am going to show how to add event data by adding a new piece to the tree.

Continue reading “Extend Yoast Schema with a New Type” ››

Remove Yoast HTML Comments in Version 11.0

If you were previously stripping Yoast HTML comments on your website then there is a good chance that updating to v11.0 will show the new schema data at the top of your website.

The problem is that a widely used snippet for stripping out the comments searched for the string ‘yoast’ and then removed the surrounding comment tags. The new schema data added in V11.0 uses the word ‘yoast’ as a class on the script tag, so the script tags get stripped and the schema data shows at the top of the website.

Continue reading “Remove Yoast HTML Comments in Version 11.0” ››

Block WordPress Image Uploads by Filename Match

Are you continually telling people to optimise their image filenames before uploading them to a website?

Do staff members keep assuring you that they will optimise their filenames in the future whilst having no intention of doing so?

Have they said “I’ll go back and do it later” rather than taking 2 seconds to do the job properly in the first place?

Then it’s time to start blocking their uploads so you don’t have to check up on them like a child 🙂 Continue reading “Block WordPress Image Uploads by Filename Match” ››

Removing WooCommerce noindex Tags on Account Login Page

If you have a website using WooCommerce and have registered it with the new version of Google Search Console, it’s likely that you will get an email notification about ‘index coverage’ issues for the /my-account/ page (Or your custom url for the same page).

Continue reading “Removing WooCommerce noindex Tags on Account Login Page” ››

Tracking Known WordPress Users in Mautic with the Official Mautic Plugin

A new option was recently added to the official Mautic WordPress plugin (Version 2.1.0), but it won’t do anything out of the box.

Here’s how to set it up to track extra information from your logged-in users.

Continue reading “Tracking Known WordPress Users in Mautic with the Official Mautic Plugin” ››

Adding Woocomerce Bought Product Tags to Mautic Users

This is a follow-up to the original post about adding Mautic tags to users based on what they view on your site.

In this post, I’m going to add (or remove) tags after check out, based on the products that the user bought. Continue reading “Adding Woocomerce Bought Product Tags to Mautic Users” ››

Tagging WordPress and Woocomerce Users in Mautic

The official WordPress plugin for Mauitc comes with a number of shortcodes, which makes it easy to add Mautic forms and content into posts and pages.

One of the shortcodes adds the ability to tag (or un-tag) visitors in Mautic depending on the pages they view. This makes it easy to tag visitors dynamically by using the shortcode within theme files.

This can be useful for many reasons. A couple that comes to mind are tagging users with the type of product that they viewed so follow up emails can be sent for similar products, or blog categories so you know which subjects each user is interested in.

The following technique can be used on any website by using the tracking pixel tag, but the following example code is specific to WordPress. Continue reading “Tagging WordPress and Woocomerce Users in Mautic” ››

Adding Custom Mime Types for WordPress Uploads

WordPress allows the upload of different filetypes to posts through custom fields, but it only understands certain file types by default.

As an example, if you wanted to allow the upload of ebook formats like epub and mobi, you need to tell WordPress how to understand those filetypes.

Continue reading “Adding Custom Mime Types for WordPress Uploads” ››

Selecting WordPress Posts That Contain a String in PhpMyAdmin

Posted in Wordpress

I was asked to find a list of posts in a WordPress install where the body text contained a certain string. Subsequently, I discovered how bad the search is in the post listing screen and decided it would be easier to find them in the database.

To just grab the useful information, I used the following SQL:

Continue reading “Selecting WordPress Posts That Contain a String in PhpMyAdmin” ››