Tutorial: Setting Up Google News Publisher Center and News Sitemap

Set up Google News Publisher Center and implement a dynamic news sitemap to ensure your articles are discovered and indexed quickly.

Prerequisites

Step 1: Prepare Your Site

Content Requirements

Before applying to Google News:

Technical Requirements

Step 2: Apply to Google News Publisher Center

  1. Go to news.google.com/publisher-center
  2. Click "Add Publication"
  3. Enter your publication name
  4. Verify site ownership (via Search Console)
  5. Configure your publication settings:
    • Publication name
    • Language
    • Location
    • Website URL

Section Configuration

Create sections that match your content categories:

Sections:
├── Technology
│   ├── AI & Machine Learning
│   ├── Software & Apps
│   └── Gadgets
├── Business
│   ├── Markets
│   └── Startups
└── Science
    ├── Space
    └── Environment

Step 3: Implement News Sitemap

Server-Side Sitemap Generation

from datetime import datetime, timedelta
from xml.etree.ElementTree import Element, SubElement, tostring
from xml.dom import minidom

def generate_news_sitemap(articles):
    urlset = Element('urlset')
    urlset.set('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9')
    urlset.set('xmlns:news', 'http://www.google.com/schemas/sitemap-news/0.9')
    
    cutoff = datetime.now() - timedelta(hours=48)
    
    for article in articles:
        if article['published'] < cutoff:
            continue
            
        url = SubElement(urlset, 'url')
        loc = SubElement(url, 'loc')
        loc.text = article['url']
        
        news = SubElement(url, 'news:news')
        
        publication = SubElement(news, 'news:publication')
        name = SubElement(publication, 'news:name')
        name.text = 'Example News'
        lang = SubElement(publication, 'news:language')
        lang.text = 'en'
        
        pub_date = SubElement(news, 'news:publication_date')
        pub_date.text = article['published'].isoformat()
        
        title = SubElement(news, 'news:title')
        title.text = article['title']
    
    xml_str = tostring(urlset, encoding='unicode')
    pretty_xml = minidom.parseString(xml_str).toprettyxml(indent="  ")
    return pretty_xml

Cron Job for Regular Updates

# Update news sitemap every 15 minutes
*/15 * * * * /usr/bin/python3 /path/to/generate_news_sitemap.py

Step 4: Configure Indexing API

Set Up Service Account

  1. Go to Google Cloud Console
  2. Create a new project
  3. Enable Indexing API
  4. Create service account credentials
  5. Download JSON key file
  6. Add service account as Search Console owner

Implementation

from google.oauth2 import service_account
from googleapiclient.discovery import build

def submit_url_to_indexing_api(url, key_file_path):
    credentials = service_account.Credentials.from_service_account_file(
        key_file_path,
        scopes=['https://www.googleapis.com/auth/indexing']
    )
    service = build('indexing', 'v3', credentials=credentials)
    
    request = service.urlNotifications().publish(
        body={
            'url': url,
            'type': 'URL_UPDATED'
        }
    )
    response = request.execute()
    return response

# Submit after publishing
submit_url_to_indexing_api(
    'https://example.com/2025/06/15/new-article',
    '/path/to/credentials.json'
)

Step 5: Monitor Performance

Search Console News Reports

Check these reports regularly:

Automated Monitoring

def check_indexing_status(url, credentials):
    service = build('indexing', 'v3', credentials=credentials)
    response = service.urlNotifications().getMetadata(url=url).execute()
    return response.get('latestUpdate', {}).get('notifyTime', 'Not indexed')

Validation Checklist