Thank you for posting your question in the Microsoft Q&A forum.
Based on the information provided and the images shared, I understand that you want to hide specific subsite links in your top navigation bar for users who do not have permission to access them. While you are aware that SharePoint Online has an "Audience Targeting" toggle for this, you are unable to find a similar option in your SharePoint On-Premises environment.
As a community moderator, I do not have access to a specific test environment to replicate your exact On-Premises setup, but I have researched the relevant documentation to provide the following insights.
Here is an explanation of how Security Trimming and Audience Targeting work in SharePoint On-Premises:
SharePoint has a native mechanism called "Security Trimming." Generally, if a navigation menu is generated dynamically based on the site structure (Structural Navigation), SharePoint automatically hides links to sites/pages the user does not have permission to see. If you have customized the menu by manually adding links (e.g., adding a specific URL label for the subsite), SharePoint treats these as simple text links. In this case, Security Trimming often does not apply automatically, and the link remains visible to everyone even if they get an "Access Denied" error when clicking it.
In SharePoint Online, there is a modern switch to easily enable "Audience Targeting" in the navigation edit pane. Unfortunately, SharePoint Server On-Premises (e.g., 2019) does not have this simple toggle in the modern interface.
To achieve link hiding (Audience Targeting) in an On-Premises environment, you typically rely on the classic "Publishing" features.
You must enable the SharePoint Server Publishing Infrastructure feature (at the Site Collection level) and SharePoint Server Publishing (at the Site level). Once enabled, you gain access to the classic "Navigation" settings page (under Site Settings). Here, you can edit links and specify a Target Audience (using SharePoint Groups or Security Groups). According to documentation, Audience Targeting typically applies to parent and child links. If a parent link is hidden from a user, the child links are usually hidden as well.
Enabling the Publishing feature changes the site's behavior and switches the navigation management to "Classic" mode. This is a significant change and might introduce classic UI elements into your modern site. However, you need Site Collection Administrator permissions to enable these features.
I recommend reviewing the official Microsoft documentation the following documents to decide if enabling Publishing is the right path for your environment:
Overview of managed navigation in SharePoint Server
Target navigation, news, files, links, and web parts to specific audiences
I hope this helps.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.