tags=`the pasted
list of tags
copied
as cells from the column`;
, the following code will check the boxes for those tags on this page:
console.log(tags.split('\n').length);
var count = 0;
tags.split('\n').forEach(function(tag) {
for (const a of document.querySelectorAll("a.row-title")) {
if ( 0 === a.textContent.localeCompare(tag)) {
console.log([a.textContent, tag])
a.closest('tr').querySelector('.check-column input[type=checkbox]').checked = true;
count++;
}
}
});
console.log( 'tags needing merge on this page: ' + count );
This will result in log output if there are tags on this page that need to be merged.
Given that removing tags from the front of the stack messes with pagination of tags later in the stack, if you have multiple pages of tags even when the list of tags is set to show 999 tags, you should click to the last page and run this script there, then on the second-to-last, then on the third-to-last, and so on.
Full preparatory snippet
tags=``;
console.log(tags.split('\n').length);
var count = 0;
tags.split('\n').forEach(function(tag) {
for (const a of document.querySelectorAll("a.row-title")) {
if ( 0 === a.textContent.localeCompare(tag)) {
console.log([a.textContent, tag])
a.closest('tr').querySelector('.check-column input[type=checkbox]').checked = true;
count++;
}
}
});
console.log( 'tags needing merge on this page: ' + count );
Process
Copy the code from under the "Full Preparatory Snippet" above into a text editor.
From the "SFPP Post Tags 3/24/20" sheet, from the "Ben's sorted version" tab:
Scroll down to find a category under the "NEW CATEGORY (LL)" column that doesn't have a "done" entry in the "Completed" column.
Copy all the tags in that column, and paste between the `` in the snippet in your text editor, making sure that each tag is on its own line.
Note down the new category that you'll be setting things to.
Change the entry in the "Completed" column for these terms to "In Progress"
Open /wp-admin/edit-tags.php?taxonomy=post_tag
Go to the last page of the tag listing.
Open your browser dev tools
Switch to the Console
Paste the whole snippet in
Hit "enter" to run the snippet
You should see output like: "tags needing merge on this page: 3". If the only number given is 0, you do not need to merge any tags on this page.
If the number is greater than 0, scroll to the bottom or top, from the "Bulk Actions" menu choose "Merge", and in the new text box add the name of the new category.
Apply.
Repeat step 3 for each of the pages of tag results, working your way from the last page of tags to the first. This order is important.
When all the tags in this batch are merged into the new term, return to the spreadsheet and set the "Completed" column entry to "done" for these tags.
When all the tags for the new category are merged:
find the merged tag in the tag list (easiest to search)
check the box for it
from "Bulk Actions" select "Change taxonomy", and then choose "Categories". Click "apply".
Go to the Categories list at /wp-admin/edit-tags.php?taxonomy=category and find the category by searching. There may be a duplicate category that needs to be merged with this one. If so, merge them.
With the following variable preparation:
, the following code will check the boxes for those tags on this page:
This will result in log output if there are tags on this page that need to be merged.
Given that removing tags from the front of the stack messes with pagination of tags later in the stack, if you have multiple pages of tags even when the list of tags is set to show 999 tags, you should click to the last page and run this script there, then on the second-to-last, then on the third-to-last, and so on.
Full preparatory snippet
Process