By default, Yoast SEO pings Google and Bing when you publish a new post with the URL of your XML sitemap. By doing this, the search engine can easily find the new URL and index it. If publishing on your site is disconnected from the URL being accessible live on the site, you will want to disable this functionality and do your own pings.
Disabling the pings
The code below disables the automatic ping:
Pinging when you're ready
When you're ready to do the ping yourself, you can do it with the code below: