Save Site as Template SharePoint 2013: Public Service Announcement

SharePoint has a handy feature that allows you to save a site as a Site Template.  This comes in handy when you want to build out a consistent structure for you sites with particular lists/libraries, etc.  I've learned there are some caveats to this feature though.

For starters, you cannot have the Publishing Features enabled if you want to be able to save a site as a template.  If you go out to MSDN you'll see that it just isn't supported.  What they don't tell you is that even if you deactivate the Publishing features in order to save a site as template it still won't let you.  Once you activate publishing, your S.O.L.  Now you will see some posts out there that say you can get around it by going into SharePoint Designer and changing the SaveSiteAsTemplateEnabled value to True, however, I've found that this isn't a reliable and consistent work around.  I've had it work once on one environment and not work on the next.  So, moral of the story here is, if you ever intend to utilize the Save Site as a Template functionality, never enable Publishing!

Second hurdle I ran into had to do with creating sites via code and then trying to save the site as a template.  I had utilized rest services to create a subsite.  I wanted to make some modifications to this and save it as a template.  When I did, I received the following error:

Error exporting the site field name "HashTags".  

I did some quick googling and it appears that I wasn't the only one having this problem and the solutions that I found were just not worth my time when I could just as easily create a subsite from scratch and make my template from there.  So, just my two cents but save yourself some headache and don't even try to save a site as a template that you've created via code.