大网数据广告活动
网站运营与故障问答

Import Canonical URL for YOAST SEO using Database

· 52CE 我爱测

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 …

问题原文

原帖链接 · Rakis Friski · CC BY-SA 4.0

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 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:

example.com/category-1/new-title
example.com/category-2/new-title
example.com/tag-1/new-title
example.com/tag-2/new-title
example.com/tag-3/new-title
example.com/tag-n/new-title

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.

已采纳解答

原帖链接 · Rakis Friski · CC BY-SA 4.0

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:

https://wordpress.org/support/topic/import-canonical-url-for-yoast-seo-using-database/#post-15421835

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2022-02-15)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。