https://github.com/prolific/sitemaps
A simple, scalable, highly extensible and seo friendly php sitemap generator. It also supports image sitemaps.
https://github.com/prolific/sitemaps
php php7 seo-friendly sitemap sitemap-generator sitemap-xml sitemaps
Last synced: 6 months ago
JSON representation
A simple, scalable, highly extensible and seo friendly php sitemap generator. It also supports image sitemaps.
- Host: GitHub
- URL: https://github.com/prolific/sitemaps
- Owner: prolific
- License: gpl-3.0
- Created: 2017-09-13T18:33:31.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-07T19:45:06.000Z (over 7 years ago)
- Last Synced: 2025-03-24T15:11:20.884Z (7 months ago)
- Topics: php, php7, seo-friendly, sitemap, sitemap-generator, sitemap-xml, sitemaps
- Language: PHP
- Homepage:
- Size: 17.6 KB
- Stars: 9
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP Sitemaps Package
A simple, scalable, highly extensible and seo friendly php sitemap generator. It also supports image sitemap.
## Installation
You can install the package through composer:
> composer require prolificrohit/sitemaps
## Examples
- For any array of urls:
```
$sitemap = new Sitemap("sitemaps/test.xml");
$sitemap->setMaxUrls(5000);
$sitemap->setBuffer(1000);
foreach ($urls as $url) {
$sitemap->addUrl($url);
}
$fileNames = $sitemap->finish();
```- To add images:
```
foreach ($items as $item) {
$sitemap->addUrl($item->link, function($url) use($item){
$url->addImage($item->image, "Caption", "Title");
});
}
```## Dependency
It is a simple php package and hence it supports all php based frameworks like laravel, zend, symfony, falcon, lumen etc. The only dependency for this package is PHP.
## Coming Soon
Support for video and news sitemap is on the way.
## License
[](https://github.com/prolificrohit/sitemaps/blob/master/LICENSE)