YouTube users can expect to see warnings before comments are posted if they contain potentially offensive material, the video-sharing site has revealed.

The Google-owned service will start prompting people to reflect should an insulting message be detected, in order to “keep comments respectful”.

The feature will not block comments altogether but will instead offer users the option of editing their post or continuing as it is.

The site said it “may not always get it right” as the new system is continuously learning.

“Our system learns from content that has been repeatedly reported by users,” YouTube said.

“We hope to learn more about what comments may be considered offensive as we continue to develop it.

“We know there is more work to be done and this is just a start.”

The reminder will only appear on Android initially.

YouTube has also announced that it is testing a new comment filter tool in YouTube Studio, the backend video management area for creators.

Potentially inappropriate and hurtful comments will be automatically held for review, with the option to remove without reading them at all.

Writing on Twitter, YouTube chief executive Susan Wojcicki said: “We’ve been looking closely at how our policies and products are working for everyone, and specifically for the Black community.”