PHPackages                             dionisiy13/google-news-sitemap - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dionisiy13/google-news-sitemap

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dionisiy13/google-news-sitemap
==============================

Easy way to do sitemap for google news

v1.0.2(3y ago)1230.7k↓21.6%2MITPHPPHP &gt;=7.0.0

Since Jan 29Pushed 3y ago1 watchersCompare

[ Source](https://github.com/dionisiy13/sitemap-google-news)[ Packagist](https://packagist.org/packages/dionisiy13/google-news-sitemap)[ Docs](https://github.com/dionisiy13/google-news-sitemap)[ RSS](/packages/dionisiy13-google-news-sitemap/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

Google News Sitemap
===================

[](#google-news-sitemap)

[![Packagist](https://camo.githubusercontent.com/af8f8113b95731f0cd0cdeed8cae3a5d9110adccf8237e7b08e450e3ab6ed7e8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64696f6e6973697931332f676f6f676c652d6e6577732d736974656d61702e737667)](https://packagist.org/packages/dionisiy13/google-news-sitemap)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/eb60453c80a8ad0abcc8ac36827061b46c7ed49c5a597d0d34a6d79024cc3a1a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64696f6e6973697931332f676f6f676c652d6e6577732d736974656d61702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dionisiy13/google-news-sitemap)

Class for generating the sitemap for google news. More about google news sitemap [here](https://support.google.com/news/publisher/answer/74288?hl=uk)

Example of the sitemap from google

```

   http://www.example.org/business/article55.html

       The Example Times
       en

     PressRelease, Blog
     2008-12-23
     Companies A, B in Merger Talks
     business, merger, acquisition, A, B
     NASDAQ:A, NASDAQ:B

      https://example.com/image.jpg

      https://example.com/photo.jpg

```

Install
-------

[](#install)

Via Composer

```
$ composer require dionisiy13/google-news-sitemap
```

Usage
-----

[](#usage)

```
$sitemap = new \Dionisiy\SitemapGoogle\Sitemap($pathToFile);
$siteName = "example.com";
foreach ($posts as $item) {
    $sitemap->setGenres("Blog");
    $sitemap->setKeywords($item['tags']);
    $sitemap->setLanguage("en");
    $sitemap->setLoc($item['url']);
    $sitemap->setName($siteName);
    $sitemap->setPublicationDate($item['publishAt']->getTimestamp());
    $sitemap->setTitle($item['title']);
    $sitemap->setImages($item['images']);
    $sitemap->addItem();
}
$sitemap->write();
```

`$posts` - list of news

`$pathToFile` - where the file should apear. For example `getcwd() . '/public' . '/sitemap_google_news.xml'`

`$item['date']` - should be DateTime

Tags and genres could be empty.

Credits
-------

[](#credits)

- [Dan Kurasov](https://github.com/dionisiy13)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1864 days

Total

2

Last Release

1168d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/20d64d72872fd4291aca3e553d50196689865d232ac2e52a8c6628517dab897e?d=identicon)[dionisiy13](/maintainers/dionisiy13)

---

Top Contributors

[![dionisiy13](https://avatars.githubusercontent.com/u/13090143?v=4)](https://github.com/dionisiy13 "dionisiy13 (3 commits)")

---

Tags

phpSitemapgoogle-news

### Embed Badge

![Health badge](/badges/dionisiy13-google-news-sitemap/health.svg)

```
[![Health](https://phpackages.com/badges/dionisiy13-google-news-sitemap/health.svg)](https://phpackages.com/packages/dionisiy13-google-news-sitemap)
```

###  Alternatives

[rumenx/php-sitemap

Framework-agnostic Sitemap generator for PHP, Laravel, and Symfony.

1.3k15.1k1](/packages/rumenx-php-sitemap)[ultrono/laravel-sitemap

Sitemap generator for Laravel 11, 12 and 13

36412.6k6](/packages/ultrono-laravel-sitemap)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
