Woman traveling alone in Morocco
All hotels in Morocco are single woman friendly as a couple cannot register for 1 room without marriage documents. Though my husband did find a way (cash) around this in Casa for the night I arrived back for the wedding. Single women for the most part are not bothered in Morocco. The reason being is that men do not know if a woman, even out alone, is connected to a man who may show up. By in large men don't want to bother women in Morocco either for Islam or for the, sometimes, kick they receive for doing so. Before I married and was living there nobody ever bothered me except once and he was homeless and mentally ill. The second it happened a crowd of men arrived to protect me and he was kicked in the butt and made to go away.
I used to live in Essaouira and adored it. I never used sources other than real people for my information and had little, compared to what I thought I knew, when I moved to Morocco. It is home. Here is a photo of the old house in Essaouira for you.
re: Hajar A
i believe that the marriage document rule only applies to couples with a moroccan half - my boyfriend and i have spend much time traveling in morocco (including renting an apartment for a year), and never had to show any type of marriage documentation. i'm often mistaken for a moroccan woman (until people hear my horrible accent!), but once we showed our passports, there was never a problem. i did, however, have some difficulties as a woman when my partner was not around - being followed, harassed; etc - don't be afraid to be forceful and ask men to leave you alone!
I just came back from a month in Morocco, and I can't imagine being asked for marriage documents. Nobody seemed bothered about the status of my relationship. I travelled for a few days in a group, where one man took single rooms - and that was also not a problem. I can't imagine hotels being an issue for you.
Street harrassment, unfortunately, is bound to be a real issue. Finding a place to have a coffee or tea might be challenging (most are male bastions). But you'll have a great time despite the challenges!
Essaouria is the easiest, there are plenty of cafes and small restaurants in the medina where you can have a comfortable meal by yourself. I'm trying to remember a homey little place my guide took me to for tagine, there was a moroccan woman dining by herself - the only time I ever saw that on my 2 trips to the country! But in essaouria you can comfortably sit in any of the cafes, it's mostly tourists, in other cities in morocco the cafes are the domain of men (but if that's the case look for a cafe with an upstairs - you will sometimes find women hanging out there).
You will also be comfortable by yourself in many places in Casablanca - it's not very touristy but more because it's a big city. I spent a few evenings soaking up the scenes in outdoor cafes and was quite comfortable.
Street food is always an excellent option. Look for the amazing garlic/butterbean soup (2nd photo) and grilled meats in fes, homemade doughnuts, amazing cheap bread everywhere. The stalls in the main square in Marrakech is famous (1st photo), and you can have some wonderful food here (look for stalls filled with locals, not where they are pressuring you to sit down) but I was not comfortable hanging around there by myself as it got late.
Dress conservatively. My first trip was in the summer and I wore what I thought were very conservative, loose fitting t-shirts, but my bare arms attracted a bizarre amount of attention in Fes (the most conservative city on you list). I bought some shawls and covered my arms, it made a huge difference. The only place you will feel comfortable with some skin showing in public is essaouria. DO go to the hammans - especially the ones where the locals go - you can really bond with the women here they will be fascinated with you.
Have a great trip, I love morocco, need to get back soon!