As a fun project I've written my own URL shortening service. I'd like to know if it makes sense / be useful to include the shortened URLs in the generated XML sitemap. At the moment I'm leaning towards not including them but I need other, more knowledgeable people's opinion.
No, the shortened URL should not go in the XML sitemap.
The shortened URL presumably redirects to the long (canonical) URL. Only the canonical URL should appear in the XML sitemap. If the canonical URL is an external resource then that wouldn't be in the XML sitemap either. (The XML sitemap identifies resources on your own site that you want to be considered for indexing.)
Agreed except in the probably unlikely event you want to make a custom short url the one that you want the search engines to place higher priority on.
To do this you:
- make a copy of the page and name it with the shortened name.
- emove any canonical code from the original and make the new copy canonical
Short is better and now you've made it canonical. Piece of cake.