How can I filter for items that have not been tagged?

I'm cleaning up some messy tagging for forum list (Q&A) that has 450 questions to make the filtering work better--cleaning up inconsistently used product tags, etc. I would like to find questions that have no tagging at all to fix those, but I don't see a way to discover those in the reporting, the Manage Forum/Tags, the REST API endpoints, or elsewhere. Is there a way to filter for untagged questions that I'm not seeing? Thanks! 

Parents
  • Unfortunately, there's not a straightforward way of querying for content that doesn't have tags in the UI - only the opposite. However this could be accomplished with a bit of code to call the API to iterate through forum threads to build a list of threads without tags. Here's an example using server-side JavaScript which can be executed in the Script Sandbox of Widget Studio.

    // which forum to loop through
    var FORUM_ID = 4;
    
    // get first 100 threads in forum
    // this could be improved to iterate multiple pages of results
    var threads = core_v2_forumThread.List({ 
        ForumId: FORUM_ID,
        PageIndex: 0,
        PageSize: 100
    });
    
    // filter the results to only those without tags
    var threadsWithoutTags = threads.filter(function(thread){
    	return (!thread.Tags || thread.Tags.length == 0);
    });
    
    // write the URLs of all matching threads
    return threadsWithoutTags.map(function(thread) {
    	return thread.Url;
    });

Reply
  • Unfortunately, there's not a straightforward way of querying for content that doesn't have tags in the UI - only the opposite. However this could be accomplished with a bit of code to call the API to iterate through forum threads to build a list of threads without tags. Here's an example using server-side JavaScript which can be executed in the Script Sandbox of Widget Studio.

    // which forum to loop through
    var FORUM_ID = 4;
    
    // get first 100 threads in forum
    // this could be improved to iterate multiple pages of results
    var threads = core_v2_forumThread.List({ 
        ForumId: FORUM_ID,
        PageIndex: 0,
        PageSize: 100
    });
    
    // filter the results to only those without tags
    var threadsWithoutTags = threads.filter(function(thread){
    	return (!thread.Tags || thread.Tags.length == 0);
    });
    
    // write the URLs of all matching threads
    return threadsWithoutTags.map(function(thread) {
    	return thread.Url;
    });

Children