Skip to main content
ighita
Staff
Staff

How to enable Keyword Blocking using a Content Filter

Description


How to block keywords using a Content Filter.

 

Scope

 

FortiGate.


Solution

 

Navigate to Security Profiles -> Web Filter, edit the Web Filter Profile in use, enable the Web Content Filter, and select 'Create New'. 

 

keyword1.jpg


The user is prompted to enter a keyword or a regular expression that will be blocked by the search engines. Enable the filter by toggling Status and selecting OK. 

 

keyword1_5.jpg

 

After performing the above, the activity will be blocked in all search engines except Google Search. Execute the commands below to block keywords in the Google search engine:

 

config web-proxy profile
edit "web_profile"
set strip-encoding enable
next
end
 
config web-proxy global
set proxy-fqdn "default.fqdn"
set webproxy-profile "web_profile"
end


These commands should be used in a proxy inspection-based profile only. The above options in the CLI are not available in FortiOS 5.4.  

Note:

If this Web Filter is intended to inspect sites that use HTTPS, then deep inspection is required on the Firewall Policy.

If deep inspection is not enabled, the FortiGate is not able to view inside the encrypted session, and the content filter may not work as intended.

More details can be seen in the documentation for this feature:
Administration Guide - Deep inspection

To do the troubleshooting, use the commands below:

 

diag debug reset
diagnose debug urlfilter src-addr x.x.x.x <- The source IP.
diag debug appl urlfilter -1
diag debug console timestamp enable
diag debug enable

 

keyword2.1.jpg

 

keyword2.1.jpg

 

As seen above, both Google and Bing search engines block search queries containing a blocked keyword. 

 

Note:

This solution does not work for HTTPS/3 because this protocol uses QUIC to establish the connection. Block UDP port 443 or block the QUIC protocol in the application to force the clients to use HTTPS/2 over TCP.

 

See the following article for assistance with blocking Google searches for particular words. It might help to block a Google search for a particular word:
Technical Tip: How to block users from searching for a specific word on Google

Related article:

Technical Tip: How to enable Keyword Blocking using a Content Filter.

    Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024