An avel is forbidden from haircutting, as the Merciful One said to Aharon: "Do not let your heads grow wild" – from this we learn that an avel is forbidden from shaving (Moed Katan 14b), whether the hair of his head or the hair of the body, and even hair of the private areas, for the entire thirty days. Regarding hair on the lip and from the sides, anything that interferes with eating, there are various opinions on this as explained in the Tur (Tur Yoreh Deah 390), see there. And our teacher, the Beit Yosef, even though in his great work he inclined toward a prohibition for the entire thirty days, nevertheless in the Shulchan Aruch section 1 (Shulchan Aruch Yoreh Deah 390:1) he ruled that within the seven days it is forbidden, but after the seven days it is permitted. And his reason appears to me to be because in the Yerushalmi of Moed Katan there, Rav said that the lip is like the trimming of nails. And it is likewise implied in our Gemara in Moed Katan (Moed Katan 17b), see there. And there (Moed Katan 18a) it is explained that nails and the lip are permitted on Chol HaMoed. And regarding nails, an avel is equal to Chol HaMoed, as will be explained. Therefore, granted that during the seven days it is forbidden, nevertheless during the thirty days it should be permitted just as on Chol HaMoed, and this is the opinion of the Ba'al HaHalachot Gedolot (see Beit Yosef).
אבל אסור בתספורת, מדאמר ליה רחמנא לאהרן: "ראשיכם אל תפרעו" – שמע מינה דאבל אסור בגילוח (מועד קטן יד ב), אחד שיער ראשו ואחד שיער הגוף, ואפילו שיער של בית הסתרים, כל שלושים יום. ושיער שעל השפה ומהצדדים, כל שמעכב את האכילה, יש בזה דעות שונות כמבואר בטור (טור יורה דעה שצ), עיין שם. ורבינו הבית יוסף אף על פי שבספרו הגדול הכריע לאיסור כל שלושים, מכל מקום בשולחן ערוך סעיף א (שולחן ערוך יורה דעה שצ, א) פסק דתוך שבעה – אסור, אחר שבעה – מותר. וטעמו נראה לי משום דבירושלמי דמועד קטן שם, אמר רב דשפה הוי כנטילת צפרניים. וכן משמע בש"ס שלנו במועד קטן (מועד קטן יז ב), עיין שם. ושם (מועד קטן יח א) מבואר דצפרניים ושפה מותר בחול המועד. ולעניין צפרניים שוה אבל לחול המועד, כמו שיתבאר. ולכן נהי דבשבעה אסור, מכל מקום בשלושים יש להתיר כמו בחול המועד, וזהו דעת בה"ג (עיין בית יוסף).