Alphabet Inc.’s Google is planning to introduce an ad-blocking feature in the mobile and desktop versions of its popular Chrome web browser, according to people familiar with the company’s plans.

The ad-blocking feature, which could be switched on by default within Chrome, would filter out certain online ad types deemed to provide bad experiences for users as they move around the web.

Google could announce the feature within weeks, but it is still ironing out specific details and still could decide not to move ahead with the plan, the people said.

Unacceptable ad types would be those recently defined by the Coalition for Better Ads, an industry group that released a list of ad standards in March. According to those standards, ad formats such as pop-ups, auto-playing video ads with sound and “prestitial” ads with countdown timers are deemed to be “beneath a threshold of consumer acceptability.”

In one possible application Google is considering, it may choose to block all advertising that appears on sites with offending ads, instead of the individual offending ads themselves. In other words, site owners may be required to ensure all of their ads meet the standards, or could see all advertising across their sites blocked in Chrome.

Google declined to comment.

The ad-blocking step may seem counter-intuitive given Google’s reliance on online advertising revenue, but the move is a defensive one, people familiar with the plans said.

Uptake of online ad blocking tools has grown rapidly in recent years, with 26% of U.S. users now employing the software on their desktop devices, according to some estimates.

By switching on its own ad-filter, Google is hoping to quell further growth of blocking tools offered by third-party companies, the people said, some of which charge fees in exchange for letting ads pass through their filters.

Google already pays to be part of an “Acceptable Ads” program offered by software company Eyeo GmbH, for example, which develops popular ad-blocking tool Adblock Plus. As a result, advertising on Google’s search engine and some of the other ads it powers are allowed to pass through Adblock Plus’s filters.

But the continued growth of ad-blocking is a worrying trend for Google, which generated over $60 billion in revenue from online advertising in 2016. It’s also a concern for other online publishers and services that rely on advertising revenue to support their businesses, many of which work with Google to help sell advertising space on their properties.

The Chrome browser now accounts for a large portion of web-browsing globally, so switching on ad-filters within it could give Google more control over the ad-blocking situation, industry observers say.

In the U.S. Chrome has nearly 47.5% of the browser market across all platforms, according to online analytics provider StatCounter.

Write to Jack Marshall at Jack.Marshall@wsj.com