Five members of a drill group have been given heavy restrictions on making music with violent lyrics and ordered to inform police of new videos and upcoming performances.
In what is believed to be the first order of its kind, a judge on Friday also banned Yonas Girma, 21, Micah Bedeau, 19, Isaac Marshall, 18, Jordan Bedeau, 17, and Rhys Herbert, 17, from mentioning death or injury in songs or on social media.
The gang members who are part of the 1011 drill group - based in Ladbroke Grove, west London - have had millions of views on YouTube with tracks in the genre linked to a rise in violent crime.
Recorder Ann Mulligan, sitting at Kingston Crown Court, issued the three-year criminal behaviour orders applied for by the Metropolitan Police's Trident gang unit after the men were locked up for conspiracy to commit violent disorder.
Police have connected the genre of rap music - which often features masked or hooded groups talking about hedonistic lifestyles and their relationships with guns, drugs and stabbings - with a rise in violent crime in the capital.
The orders say that, on social media and in music videos and performances, the men must not encourage violence, mention named postcodes in a gang context, or make reference to the death of Teewiz, the nickname of 19-year-old Abdullahi Tarabi, who was fatally stabbed in west London.
They must also notify police within 24 hours of releasing new videos and give 48 hours warning of the date and location of any performance or recording and permit officers to attend.
The men must also not possess balaclavas or attend Notting Hill Carnival.