Morocco is a safe country for tourists, so the short answer is : Yes : Traveling Morocco alone is safe.
Morocco is not a difficult country to travel alone, but there are some tips and tricks that can make your experience more enjoyable and save you from wasting time and money.
Road conditions are generally safe for travel, and violent crime is much less common in Morocco than, for example, in the United States. Robberies do happen, and if you can not negotiate in one of the three local languages (Arabic, French, or Tamazight), you’ll likely be overcharged when shopping in the zoco (market) or taking taxis around town. The “Tourist Police” is a Moroccan security force dedicated to ensuring the safety of foreign visitors, which is who you should contact if you are the victim of a crime.
Morocco attracts more and more tourists
Morocco has seen a huge increase in the number of foreign visitors in recent years, stats show that more 10 Million visitors in 2020.
As many tourists seek a unique and adventurous travel experience. When traveling to a country that meets these requirements, other aspects, such as public safety and social norms, may be different from what you are used to.
Is Morocco safe for a solo female traveler ?

Morocco is a Social and open to all cultures. Even though Morocco is a poor country, it’s pretty safe for foreign women to travel to alone.