Is there anyway to upload (import) a Canonical URL for YOAST SEO using Database (inject bulk method)? I'm quite confused as which table and field it used for the data in the database that use for YOAST SEO canonical URL field.

I stumbled in this problem since my team just realize when we using categories and tag, it will trigger duplicate content problem since if we leave this Canonical URL Field Blank field blank. It will automatically generate the link based on the current URL. but here the problem lies, let say, we have this post data:

Post Data:
title: new title
category: category 1, category 2
tag: tag 1, tag 2, tag 3, tag n

content: some content

based on meta above, wordpress will generate around 6 different link that will make it duplicate content since all the link have the same content but it will generate different link, such as:


so We have this idea to bulk a new canonical URL for the old post (around more than 900 post) using database since it will take much time to manually add it 1-by-1.

let's say I want this as the main content for canonical URL: example.com/category-1/new-title

so the other link will point that all of them duplicate to this main link. But we can't find which field and table that canonical URL lies in database, so can anyone help me regarding this problem? it's better if you give the example SQL script to replace all the canonical URL data using it.

1 Answer 1


Finally After several day, I found the answer in this link: https://larryludwig.com/how-to-make-bulk-edits-to-content-in-wordpress/

from There you can find the the table using this:

SELECT * FROM `wp_postmeta` WHERE meta_key='_yoast_wpseo_canonical'

so if you want to bulk upload you can use this field _yoast_wpseo_canonical in wp_postmeta using meta_key

Update: Mar 4th, 2022

for more information, thread that I make in wordpress forum, finally got an Answer so maybe you want to check it out too in here for more information regarding Canonical in Yoast SEO:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.