A canonical URL tells search engines which address is the original version of a page. You need one when the same article is published on two sites, when a post was copied from another blog with permission, or when several posts cover the same product and one of them should rank. Yoast SEO and Rank Math have a canonical field in each post, but filling it post by post is slow once there are dozens of copies. With Import Export by RockStarLab, you export the posts, put the canonical URLs into a spreadsheet and import them back in one run.
Free: export and import of posts with SEO fields are in the free plugin. The test below used Import Export by RockStarLab 2.2.13 and Yoast SEO 28.8.
Short Answer
Yoast stores the canonical URL of a post in the custom field _yoast_wpseo_canonical; Rank Math uses rank_math_canonical_url. Export the posts with ID, Title, Slug, Permalink and the Canonical URL column. Fill the canonical column with the URL of the original page, keep only ID, Title and the canonical column, and import the file with Check for Existing Items by Field set to ID, Update for matches and Skip for rows that don’t match.
Export the posts that need a canonical URL
In our test, three posts had been copied from a main site to a second site. Two of them should point to the originals on the main site; the third should keep its own URL.
On the second site, in the plugin’s Export, we chose Blog Posts and filtered by the three categories the copies were in. On the Fields step we dragged in ID, Title, Slug and Permalink from Standard and Canonical URL from the Yoast SEO group:

The CSV had an empty canonical column, because none of the posts had a canonical URL yet. An empty value means Yoast uses the post’s own permalink.
Fill the canonical URLs in the spreadsheet
For each copy, put the full URL of the original post into _yoast_wpseo_canonical. When the originals are on another WordPress site, export Slug and Permalink there too and look up the URL by slug with VLOOKUP or XLOOKUP; in our case the slugs were the same on both sites.
Then delete the rows that keep their own URL and every column except ID, post_title and _yoast_wpseo_canonical. The file we imported:
| ID | post_title | _yoast_wpseo_canonical |
|---|---|---|
| 7321 | Ethiopia Guji Natural: Brewing Notes | http://aie6.local:10096/2026/11/13/ethiopia-guji-natural-brewing-notes/ |
| 7319 | Kenya AA Roast Profile | http://aie6.local:10096/2026/11/13/kenya-aa-roast-profile/ |
The URLs point to our test copy of the main site; on a live site they are your original post URLs, with https://.
Import the canonical URLs
In Import, we chose Blog Posts, uploaded the file and clicked Auto Map. The three columns were mapped to the fields with the same names:

On the Options step we set Check for Existing Items by Field to ID, kept Update for matches and chose Skip when no match is found, so a wrong ID can’t create a new post:

Both posts were updated:

In the Yoast SEO box of Ethiopia Guji Natural: Brewing Notes, under Advanced, the Canonical URL field showed the original post’s address:

The third post, which wasn’t in the file, kept an empty canonical field and still points to itself.
Things to know
- To remove a canonical URL, leave its cell empty and import the file the same way; the post goes back to its own permalink.
- Yoast doesn’t output a canonical tag on pages set to noindex, so check the tag on an indexed page. In the page source, look for
<link rel="canonical". - Rank Math works the same way with the column
rank_math_canonical_url. - For pages and custom post types, choose them in step 1 of the export and the import; the field name is the same.
- If the copies were made with Content Sync, a later push from the main site replaces the canonical URL with the main site’s value. Import the canonical file again after the last push, as described in syndicating blog posts to several sites.
Before importing, back up the site, or ask your AI agent to start the backup.
With an AI agent
Import Export by RockStarLab gives AI agents its exports, imports and Content Sync as abilities. Through the WordPress MCP Adapter, WordPress itself offers an agent only read-only abilities for site, user and environment information, so without the plugin the agent cannot do the steps above (to connect an agent, see connecting Claude Code to WordPress). With it, one request is enough:
With Import Export by RockStarLab, which posts have a Yoast canonical URL, and where do they point?
In our run, the agent called rsl-ie/export-preview for posts with a meta_query on _yoast_wpseo_canonical not empty and the fields ID, title and canonical URL. It returned the two posts from the file, each pointing to its original on the main site.
FAQ
How do I bulk change canonical URLs in WordPress?
Export the posts with ID and the SEO plugin’s canonical column, fill in the URLs in a spreadsheet, and import the file with matching by ID and Update.
Where does Yoast SEO store the canonical URL?
In the post’s custom field _yoast_wpseo_canonical. Rank Math uses rank_math_canonical_url.
Should a copied post have a canonical URL?
If the copy repeats the original without changes and the original should rank, point the copy’s canonical URL to the original. A rewritten or translated post can keep its own URL.
How do I remove a canonical URL from many posts?
Leave the canonical cell empty for those posts and import the file with matching by ID and Update.
Related Guides
- Syndicate Blog Posts from One WordPress Site to Several Sites
- How to Bulk Update Yoast SEO Titles and Meta Descriptions from CSV
- Find All Noindex Posts in Yoast SEO and Review Them in a Spreadsheet
- How to Export All Site URLs to CSV or Excel in WordPress
Get the free plugin on WordPress.org.

Comments 0
Have a question or a tip to share? Leave it below.