Home › Forums › Support › Exclude tags from tag cloud blog on GP sidebar element This topic has 5 replies, 2 voices, and was last updated 3 years, 8 months ago by David. Viewing 6 posts - 1 through 6 (of 6 total) Author Posts August 21, 2022 at 2:47 pm #2319418 George I am using this code in an attempt to exclude certain tags from a tag cloud widget block that I have on my GP sidebar element: add_filter( 'widget_tag_cloud_args', 'gm_exclude_tag_from_tag_cloud'); function gm_exclude_tag_from_tag_cloud( $args ) { $args[ 'exclude' ] = '46,42,48,43,49,47,50'; return $args; } It doesn’t seem to work. I suspect it’s because I use a tag cloud block and not an actual WordPress widget. Is there a solution? August 22, 2022 at 2:56 am #2319788 DavidStaff Customer Support Hi George, i assume they would use the wp_tag_cloud function in the Block. And that has a filter hook: https://developer.wordpress.org/reference/hooks/wp_tag_cloud/ And you can see its Args here: https://developer.wordpress.org/reference/functions/wp_tag_cloud/ So simply swapping the hook name may work: add_filter( 'wp_tag_cloud', 'gm_exclude_tag_from_tag_cloud'); function gm_exclude_tag_from_tag_cloud( $args ) { $args[ 'exclude' ] = '46,42,48,43,49,47,50'; return $args; } August 22, 2022 at 4:37 am #2319887 George Thanks, David. It’s so weird, it only removes one tag beginner and shows this message at the top: 4a href="SITEURL/tag/beginner/" class="tag-cloud-link tag-link-42 tag-link-position-1" style="font-size: 10pt;" aria-label="beginner (3 items)">beginner I’ve attached a URL. August 22, 2022 at 5:43 am #2319954 DavidStaff Customer Support Found this: https://github.com/WordPress/gutenberg/issues/33990 No fix as yet. Might want to resort to a classic widget or use a shortcode August 22, 2022 at 7:41 am #2320073 George Awesome, shortcode works, thanks David! August 22, 2022 at 7:46 am #2320081 DavidStaff Customer Support Glad to hear that 🙂 Author Posts Viewing 6 posts - 1 through 6 (of 6 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In