Piece Of Cake

Over 25 years ago, I walked into Angel’s bakery on Rechov Shmuel HaNavi. My friends and I had gathered funds together to purchase a birthday cake for another mutual friend. For some reason, after never celebrating birthdays in high school, everyone celebrated their birthday in beis midrash. (It’s probably for the same reason that high-schoolers rallied against their parents’ chol ha’moed trip to the zoo, yet those very same bachurim organized their own bein ha’zemanim zoo trips.)
In my broken Hebrew, I asked the man behind the counter to write “Happy Birthday” on the cake. He responded that they were not allowed to comply with my request by order of the Badatz. Instead, I could have “Happy Birthday” written on a piece of chocolate if I so desired. That practice has since become widespread in kosher bakeries in the United States as well. The idea is to prevent possible chillul Shabbos when cutting through the letters, which might violate mocheik, erasing.
Mocheik is one of the 39 melachos forbidden on Shabbos. However, there are at least three major opinions about the applicability of mocheik to cutting through letters written on top of a cake on Shabbos. The Nodah B’Yehuda writes that the practice is totally permitted. When one cuts through letters on top of a cake on Shabbos, he does not intend to obliterate the letters and words. It is just an inevitable consequence. Furthermore, the Biblical prohibition of erasing on Shabbos is only if one intends to write in the place of the erasure. Moreover, nothing positive is actually accomplished by obliterating the letters and words. Lastly, if one wanted to erase letters and words, typically one would not use a knife to cut through them. For all these reasons, if one actually did intend to erase the words on the cake by cutting through them, it would only be prohibited rabbinically. Therefore, where destroying the letters is only an unintended consequence, it is totally permitted. Similarly, according to this opinion, when one is permitted to open wrappers on Shabbos, such as opening a sugar packet, he need not be concerned about ripping letters. The Aruch HaShulchan says that the halachah is in accordance with this lenient opinion; however, one should try to be stringent.