SEO Meta tags not workring for custom post types

Hi folks,

I’ve been trying to implement SEO head tags based on the following article:

I did the following:

  1. Installed Yoast SEO
  2. Added meta tags to my pages/custom post types
  3. Installed REST API - Head Tags
  4. All of the head tags are exposed by the api
  5. On Frontity project I added the package frontity-head-tags
  6. No errors, all good

Now, the problem is that my meta tags are working only for pages, but not for my custom post type which in this case are Services. For Services, the title, description and other tags are randomly picked from another page. In this case, I see title from the Privacy page on every custom post type page (services/:slug).

Do I have to manually configure title in my component for my custom post type like it’s done with the isPostType like this:

if (data.isPostType) { ... load and set the title here }

So that I need to do something like this:

if (data.isServicesPostType) { ... load and set the title here }

Thank you very much in advance.

[Solution]: The problem was custom taxonomy, which somehow mixed up with the custom post type. Basically, whenever I accessed the custom post type page, the title and other meta tags were overwriting the custom post type’s data. Deleting the custom taxonomy solved the problem that was assigned to the custom post type solved the problem.

1 Like

Hi @mh123

Great that you figured out your problem. Thanks for sharing the solution with the rest of the community.