SAN FRANCISCO — YouTube said on Wednesday that it had dropped Logan Paul, one of its most popular stars, from its top advertising ranks and had suspended production of a YouTube movie that he was supposed to appear in.

Late last month, Mr. Paul faced a deluge of criticism after posting a video that appeared to show a dead body hanging from a tree in a Japanese forest known as a destination for suicides. Mr. Paul took the video down and apologized for what he called a “misguided” decision.

The move to punish Mr. Paul a week after the video surfaced highlights how YouTube, which is owned by Google, is slowly coming to grips with controversial content. The issue is becoming more apparent as the online service replaces television as the main entertainment platform for younger audiences.

Top YouTube stars like Mr. Paul, known for pushing the envelope with outlandish behavior that would not be acceptable on mainstream television, present a particular problem. Their antics build an online audience, but can create a cycle of boundary testing as they look for ways to keep their viewers entertained.