FireWire 84 Posted June 6, 2019 Hey everyone- We recently had a need come up for a website. After launching our website the company hired an SEO specialist who is doing some significant work revising and optimizing content. To help enhance this process I wrote a very simple module that automatically submits the website's sitemap.xml file to Bing and Google when a page is published, or when a page is saved that was already published. As for our reasoning- there's a lot of information available as to why submitting your sitemap regularly can be beneficial. In classic Google style their official documentation says that there "is no guarantee" that submitting a sitemap alone will trigger a re-indexing by Google's bots. That said, devs have done tests where there is a strong coincidence between a sitemap submission and activity by Google bots on that website. Google has stated that there is no limit or cap on the number of times you can submit a sitemap so there is no penalty for triggering this for every change. For more details and the hard science visit this excellent article https://trevorfox.com/2018/09/ping-sitemaps-search-engines/ This module does the following: Hooks into save/publish Checks that the sitemap.xml URL is valid and a sitemap is available. This is done through a cURL request instead of file checking to account for plugins such as MarkupSitemapXML that generate the sitemap dynamically on demand. Submits sitemap ping to Google and Bing Logs activity Shows a warning if the sitemap was not submitted after a page save/publish. Which could help a user notify the site developer if something isn't working. My primary question is quality of code and using hooks correctly. I used two addHookAfter published and saved to trigger pings in the init() function. Is there a better way to hook into multiple events or is defining the hooks separately the way to go? I haven't created a lot of modules and wanted to give the community a chance to critique it before considering adding it to the module directory. Source is located at: https://github.com/skylundy/ProcessAutoSitemapSubmit Thanks for any feedback or critique! 2 1 Share this post Link to post Share on other sites
flydev ππ» 1,860 Posted June 10, 2019 Just to let you know that the idea is brillant and your module come in handy. IΒ am sure we will have some feedback and pull-requests in the next weeks. To give some more visibility to the module, you could show us how/why to use it in conjunction with the others SEO modules existing here. Thanks again mate πΒ π Share this post Link to post Share on other sites
FireWire 84 Posted June 10, 2019 9 hours ago, flydev said: Just to let you know that the idea is brillant and your module come in handy. IΒ am sure we will have some feedback and pull-requests in the next weeks. To give some more visibility to the module, you could show us how/why to use it in conjunction with the others SEO modules existing here. Thanks again mate πΒ π That's a great idea. I'm going to add some information to the configuration screen with recommendations and information on that as well. Would this benefit from creating a post in the Modules/Plugins forum since this one is in the Module/Plugin Development forum? I initially wanted to see if there's any critiques or feedback that showed it wasn't ready for primetime but I think it is. Share this post Link to post Share on other sites