Advanced Custom Fields allows you to add custom metadata to your content. For example, if you own a job listing site, you can create a custom field to specify whether a job is a full-time, part-time, or contract job.
That way, you don’t need to retype those details into every post. At the same time, you can easily include it in the custom Schema/SEO metadata generated by Rank Math without adding any new code to your site.
In this tutorial, we’ll show you how easy it is to make Rank Math fully compatible with the Advanced Custom Fields WordPress plugin.
Table Of Contents
1 How to Use Advanced Custom Fields With Custom Schema/SEO Metadata Generated by Rank Math
1.1 Install and Activate Advanced Custom Fields
First and foremost, you need to install and activate the Advanced Custom Fields plugin. To do so, navigate to the Plugins → Add New section from your WordPress dashboard.
Search for the Advanced Custom Fields plugin in the search bar and install and activate it, as shown below.
1.2 Enable the ACF Module in Rank Math
Once you have installed and activated the plugin, enable the ACF module in Rank Math by navigating to WordPress Dashboard → Rank Math SEO → Dashboard section, as shown below.
1.3 Create a Custom Field
The next step is to create a custom field. To do so, navigate to Custom Fields → Add New section, as shown below.
The Custom Fields settings provide you with several options. Let’s look at them in detail.
1.3.1 Field Group Title
Just as a group of related blog posts can be listed under a category, a group of related custom fields can be listed under a Field Group. The name of the Field Group is the Field Group Title.
For this example, let’s assume we want to add custom fields containing details like pay, job requirements, and job type to our job listing site. We can use Job Details as our Field Group Title.
1.3.2 Field Type
The Field Type you select depends on the data you want to add to the custom field. In this example, we want the Job Type to be a dropdown menu with a list of options, so we’ll choose Select, as shown below.
1.3.3 Field Label
The Field Label is the name of the meta box that will appear in your Screen Editor. In this example, our Field Label will be Job Type, as shown below.
1.3.4 Field Name
The Field Name is the variable you will paste into the custom Schema/SEO metadata generated by Rank Math. It must be a single word without spaces. However, you can use dashes and underscores. Let’s call it job_type, as shown below.
Note: A few extra options may appear depending on the Field Type you selected. You should fill them accordingly and proceed.
Once done, scroll to the top of the page and click on the Save Changes button, as shown below.
1.4 Include the Custom Field Value in Your SEO Metadata
Note: This is not applicable if you selected Repeater Fields in Field Type.
Navigate to the post editing screen where you wish to add the custom field. The Advanced Custom Fields meta box is below the screen editor.
Select or fill in the value as applicable. In this example, we will select Full-time Jobs, as shown below.
Next, copy the variable below and replace FIELD_NAME
with the Field Name you set in section 1.3.4. In this example, our Field Name is job_type.
%customfield(FIELD_NAME)%
Once done, navigate to the Rank Math meta box and click on Edit Snippet, as shown below.
Paste the variable in the Rank Math Snippet Editor. In this example, we pasted the variable in our Title, as shown below.
Once done, click on Save/Publish to save your changes.
2 How to Enable ACF Images in the Sitemap PRO
You can also add the images in your ACF fields to your sitemap. To do that, navigate to Rank Math SEO → Sitemap Settings → General tab. Then scroll down to Include Images from the ACF Fields option and enable it, as shown below.
Once done, click on the Save Changes button to save your settings.
And that’s it; we hope you’re able to integrate Rank Math with Advanced Custom Fields. If you have questions, you’re always more than welcome to contact our dedicated support team. We’re available 24/7, 365 days a year…