To avoid roaming charges, it's possible to buy a local SIM card in Morocco. Make sure that your phone is unlocked before you leave home so a local SIM will be compatible. Morocco has three main mobile phone networks – Meditel, Maroc Telecom and Inwi – all of which have great coverage but may be less effective in remote areas. 4G is widely available in the main cities and towns of Morocco.
You'll be able to buy a SIM from a teleboutique, at a newsstand, kiosk or convenience store, and this will usually set you back around 100 dirhams (around USD 10) for a fair amount of calls and mobile data. Depending on the time you travel, there will be a range of prepaid deals offered by these providers.
Please note that some Moroccan telecommunications companies have blocked the call feature on internet calling apps like Skype and WhatsApp so customers will use their local call network. Messaging services on these apps are not blocked. If you'd like to call with apps like this during your time in Morocco, you may need to install a Virtual Private Network (VPN) on your mobile phone.