To hide videos on the YouTube sidebar based on words in their titles (e.g., containing the word "crew") using uBlock Origin, you need to use uBlock's "My filters" feature with a CSS selector plus :has() with a text filter.
Unfortunately, plain CSS selectors do not support filtering elements by text contents. But uBlock Origin supports :has() with a :contains() (in some cases) or at least :has() to detect child nodes for filtering.
However, this text-based filtering is not supported natively by CSS selectors without some advanced filters.
Step-by-step:
-
Inspect the sidebar video title element:
- The element you mentioned looks like
##.yt-lockup-metadata-view-model-wiz__title (maybe .yt-lockup-title or .title is the class usually on title elements).
- On YouTube's sidebar recommended videos, the video titles are usually inside
<a> tags with complex class names.
-
Find the right selector:
- The sidebar recommended videos often have the container element
.ytd-compact-video-renderer or .yt-simple-endpoint.style-scope.ytd-compact-video-renderer for the title link.
- Titles are usually within anchor (
<a>) elements inside these containers.
-
Use uBlock Origin filter with :has() and :contains():
uBlock Origin recently added some text filtering support. You can try a filter like:
youtube.com##ytd-compact-video-renderer:has(a:has-text(crew))
How to add this filter:
- Click on uBlock Origin icon → Open the Dashboard.
- Go to the "My filters" tab.
- Paste this filter:
youtube.com##ytd-compact-video-renderer:has(a:has-text(crew))
This filter hides any recommended video on YouTube sidebar if its <a> tag inside contains the word "crew".
Explanation:
ytd-compact-video-renderer — the sidebar video container.
:has(a:has-text(crew)) — only those whose anchor tag contains the text "crew".
Additional notes:
:has-text() is supported in recent uBlock Origin versions (1.43+).
- You can replace
"crew" with any other keyword.
- This filter is case-insensitive.
- If multiple words, either use multiple filters or a regex inside.
For multiple keywords (OR):
Since the :has-text() supports regex, you can try:
youtube.com##ytd-compact-video-renderer:has(a:has-text(/crew|example|test/i))
This hides any video with "crew", "example", or "test" in the title.
If your version of uBlock Origin is outdated, consider updating or upgrading.
Summary: Use the following filter in uBlock Origin's "My filters" to hide sidebar videos that contain "crew":
youtube.com##ytd-compact-video-renderer:has(a:has-text(crew))
Let me know if it doesn't work, and I can help adjust the selectors!