Manhattan District Attorney Alvin Bragg says YouTube is cracking down on videos that show users how to manufacture, sell and even disarm the safety devices on certain firearms.

The video hosting site’s new guidelines come after the district attorney urged the site to address the problem in an April letter.

“We have heard firsthand from young individuals that YouTube’s algorithm is driving them to the world of illegal and 3-D printed firearms, which is having a direct impact on the safety of Manhattanites,” Bragg said in a statement on Wednesday.

He added that his office would continue to “use every tool at our disposal to address illegal weapons in our communities.”

Authorities have been sounding the alarm on the number of “ghost guns” and 3-D printed firearms they continue to apprehend each year. Both weapons can be manufactured by individuals, meaning they do not have a registered serial number and cannot be tracked by the government.

The number of ghost guns recovered by the authorities nationwide increased 1,073% between 2017 and 2021, according to a report last year from the Bureau of Alcohol, Tobacco, Firearms and Explosives.

The new guidelines will go into effect on June 18 – meaning that the creators of these videos will have less than two weeks to review their content to make sure it meets the new guidelines.

A spokesperson for the company said the changes “are part of our continued efforts” to crack down on “the current state of content on YouTube.”

“We regularly review our guidelines and consult with outside experts to make sure we are drawing the line at the right place,” said YouTube spokesperson Nicole Bell.

In April, Bragg set his sights on YouTube — and its collection of videos that give users step-by-step instructions for manufacturing and selling guns.

He sent YouTube a letter pointing out the numerous videos that can be found on the platform that violate its own Community Guidelines and aren’t age-restricted. He urged YouTube to update its policies and requested a meeting with some of its representatives.

“I believe these steps are a public safety imperative to protect New York City residents, and especially our children from going down a dangerous path,” Bragg wrote in the letter.

In March, the Manhattan DA charged 18 people — some of whom were government employees — for their alleged involvement in a ghost gun ring. That same month, the parents of a Bronx teenager who was fatally shot with a ghost gun sued the company that manufactured the weapon.

This story has been updated with comment from YouTube.