In the Safari app on your Mac, choose Safari > Preferences, then click Websites.
Click Pop-up Windows.
Block pop-up windows for:
A website in the list: Select the website in the right column, then choose the option you want.
All websites that aren’t currently customised: Click the “When visiting other websites” pop-up menu in the bottom-right corner of the pane, then choose the option you want.
You can see all websites you’ve customised under Configured Websites. If you don’t see Configured Websites, either you haven’t customised a website yet or cleared the list. See Change Websites preferences in Safari on Mac.
All websites: Make sure no websites are listed under Configured Websites (to clear the list quickly, select the websites, then click Remove). Click the “When visiting other websites” pop-up menu, then choose the option you want.