{"id":128,"date":"2017-12-20T00:00:13","date_gmt":"2017-12-20T05:00:13","guid":{"rendered":"http:\/\/www.proginosko.com\/leechblock\/?p=128"},"modified":"2025-05-04T15:00:18","modified_gmt":"2025-05-04T19:00:18","slug":"keywords","status":"publish","type":"post","link":"https:\/\/www.proginosko.com\/leechblock\/faq\/keywords\/","title":{"rendered":"FAQ: Can I block pages that contain specific words or phrases?"},"content":{"rendered":"<p>The tilde prefix (~) can be used to restrict blocking to pages that contain given keywords. Within a keyword you can use an asterisk (*) to match any number of characters (except <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Glossary\/Whitespace\">whitespace<\/a>) and an underscore (_) to match <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Glossary\/Whitespace\">whitespace<\/a>. Note that the keyword matching is <strong>case-insensitive<\/strong> (i.e., uppercase and lowercase are treated as equivalent).<\/p>\n<p>So, for example, you could enter the following into the list of sites:<\/p>\n<p><code>somesite.com<br \/>\nanothersite.com<br \/>\n~anteaters<br \/>\n~crypto*<br \/>\n~*alicious<br \/>\n~green_eggs_and_ham<\/code><\/p>\n<p>This would result in pages on the sites <em>somesite.com<\/em> and <em>anothersite.com<\/em> being blocked <strong>only<\/strong> when those pages contain the complete word &#8220;anteaters&#8221; <strong>or<\/strong> any word beginning with &#8220;crypto&#8221; <strong>or<\/strong> any word ending with &#8220;alicious&#8221; <strong>or<\/strong> the complete phrase &#8220;green eggs and ham&#8221;.<\/p>\n<p>If you want to block pages on <em>any<\/em> website that contain given keywords, you&#8217;ll need to use wildcards to specify all websites. For example:<\/p>\n<p><code>*<br \/>\n~justin_bieber<br \/>\n~kim_kardashian<\/code><\/p>\n<p>If you want pages with the specified keywords to be <strong>allowed<\/strong> rather than blocked, you should select the option <em>Treat keywords as allow-conditions rather than block-conditions<\/em> under <strong>Advanced Options<\/strong>. Thus, if you were to select that option with the example above, the effect would be to block all pages <strong>except<\/strong> those containing &#8220;justin bieber&#8221; or &#8220;kim kardashian&#8221; (not something I recommend, just for the record).<\/p>\n<p><strong>Note:<\/strong> If you&#8217;re working with a language that doesn&#8217;t use <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Glossary\/Whitespace\">whitespace<\/a> to separate words, you&#8217;ll probably need to use wildcards on either side of the keyword, like this: <code>~*keyword*<\/code><\/p>\n<p><strong>Note:<\/strong> LeechBlock looks for keywords <em>only in the title or text of a webpage<\/em>, not in the URL. If you want to block URLs containing keywords, you can do so like this:<\/p>\n<p><code>somesite.com\/**somekeyword<br \/>\nsomesite.com\/**anotherkeyword<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The tilde prefix (~) can be used to restrict blocking to pages that contain given keywords. Within a keyword you can use an asterisk (*) to match any number of characters (except whitespace) and an underscore (_) to match whitespace. Note that the keyword matching is case-insensitive (i.e., uppercase and lowercase are treated as equivalent). &hellip; <a href=\"https:\/\/www.proginosko.com\/leechblock\/faq\/keywords\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">FAQ: Can I block pages that contain specific words or phrases?<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3],"tags":[],"class_list":["post-128","post","type-post","status-publish","format-standard","hentry","category-faq"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/s6LSwm-keywords","_links":{"self":[{"href":"https:\/\/www.proginosko.com\/leechblock\/wp-json\/wp\/v2\/posts\/128","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.proginosko.com\/leechblock\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.proginosko.com\/leechblock\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.proginosko.com\/leechblock\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.proginosko.com\/leechblock\/wp-json\/wp\/v2\/comments?post=128"}],"version-history":[{"count":24,"href":"https:\/\/www.proginosko.com\/leechblock\/wp-json\/wp\/v2\/posts\/128\/revisions"}],"predecessor-version":[{"id":891,"href":"https:\/\/www.proginosko.com\/leechblock\/wp-json\/wp\/v2\/posts\/128\/revisions\/891"}],"wp:attachment":[{"href":"https:\/\/www.proginosko.com\/leechblock\/wp-json\/wp\/v2\/media?parent=128"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.proginosko.com\/leechblock\/wp-json\/wp\/v2\/categories?post=128"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.proginosko.com\/leechblock\/wp-json\/wp\/v2\/tags?post=128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}