PHPackages                             nilportugues/sitemap-component - 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. [Image &amp; Media](/categories/media)
4. /
5. nilportugues/sitemap-component

ActiveLibrary[Image &amp; Media](/categories/media)

nilportugues/sitemap-component
==============================

Standalone sitemap builder 100% standards compliant. Build for PHP5.3 and above.

3.0.3(10y ago)5055.1k↓21.2%12[3 issues](https://github.com/nilportugues/sitemap-component/issues)1MITPHPPHP &gt;=5.4

Since Feb 11Pushed 6y ago2 watchersCompare

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

READMEChangelog (9)Dependencies (3)Versions (12)Used By (1)

Sitemap Component
=================

[](#sitemap-component)

[![Build Status](https://camo.githubusercontent.com/506c4108f67bcb591abb8e6c2cc2113f7cb49c1906c40f06d98ede8fea9cdfb3/68747470733a2f2f7472617669732d63692e6f72672f6e696c706f727475677565732f7068702d736974656d61702e737667)](https://travis-ci.org/nilportugues/php-sitemap) [![Coverage Status](https://camo.githubusercontent.com/4261b0e0489e8b9db5dc9b052132cd479fe4898e15ffbd63ddc26dc143000eb3/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6e696c706f727475677565732f736974656d61702d636f6d706f6e656e742e737667)](https://coveralls.io/r/nilportugues/sitemap-component) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/92d49cdfaed1890f60bda3db8922737cb3d8fd13f67489df1472d34b6272c0c7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6e696c706f727475677565732f736974656d61702d636f6d706f6e656e742f6261646765732f7175616c6974792d73636f72652e706e67)](https://scrutinizer-ci.com/g/nilportugues/sitemap-component/) [![Latest Stable Version](https://camo.githubusercontent.com/6bfdfce3be52e03cc23f249155c60f1e8122da3977ea4fb5eaddae7dad2bd76c/68747470733a2f2f706f7365722e707567782e6f72672f6e696c706f727475677565732f736974656d61702d636f6d706f6e656e742f762f737461626c65)](https://packagist.org/packages/nilportugues/sitemap-component) [![Total Downloads](https://camo.githubusercontent.com/389352edab1b65d21f8e6aae4c8ebe67b3efc9891a66e23bb113fe3f513223ed/68747470733a2f2f706f7365722e707567782e6f72672f6e696c706f727475677565732f736974656d61702d636f6d706f6e656e742f646f776e6c6f616473)](https://packagist.org/packages/nilportugues/sitemap-component) [![License](https://camo.githubusercontent.com/2653a572b96084a6dd7e81319085a86cdd63d33de9f983beb8efaf787a49af86/68747470733a2f2f706f7365722e707567782e6f72672f6e696c706f727475677565732f736974656d61702d636f6d706f6e656e742f6c6963656e7365)](https://packagist.org/packages/nilportugues/sitemap-component) [![SensioLabsInsight](https://camo.githubusercontent.com/8f684a1d29d3b8ce38bb38c20ec45d8fc9bb86b538e5215b47c31ea1242a0ef6/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f62303635613033322d346162322d346665622d613838632d6437613834323365316366372f6d696e692e706e67)](https://insight.sensiolabs.com/projects/b065a032-4ab2-4feb-a88c-d7a8423e1cf7)[![Donate](https://camo.githubusercontent.com/7b6de155df30b37b25eb5fec52f9213680c3dbf067dfb7d7e2850ac4096c7d05/68747470733a2f2f7777772e70617970616c6f626a656374732e636f6d2f656e5f55532f692f62746e2f62746e5f646f6e6174655f534d2e676966)](https://paypal.me/nilportugues)

Builds sitemaps for pages, images and media files and provides a class to submit them to search engines.

- [1.Installation](#block1)
- [2. Features](#block2)
- [3. Automatic sitemap submission](#block3)
- [4. Usage](#block4)
    - [4.1. Submit to search engines](#block4.1)
    - [4.2. Build a Sitemap Index](#block4.2)
        - [Creation](#block4.2.1)
        - [Output](#block4.2.2)
    - [4.3. Build a simple Sitemap](#block4.3)
        - [Creation](#block4.3.1)
        - [Output](#block4.3.2)
    - [4.4. Build a Sitemap with Images](#block4.4)
        - [Creation](#block4.4.1)
        - [Output](#block4.4.2)
    - [4.5. Build a Sitemap with Videos](#block4.5)
        - [Creation](#block4.5.1)
        - [Output](#block4.5.2)
    - [4.6. Build a Media Sitemap (mRSS feed as a Sitemap)](#block4.6)
        - [Creation](#block4.6.1)
        - [Output](#block4.6.2)
    - [4.7 - Build a Sitemap for News](#block4.7)
        - [Creation](#block4.7.1)
        - [Output](#block4.7.2)
- [5. Fully tested](#block5)
- [6. Questions?](#block6)
- [7. Author](#block7)

---

1.Installation
--------------

[](#1installation)

The recommended way to install the Sitemap Component is through [Composer](http://getcomposer.org). Run the following command to install it:

```
php composer.phar require nilportugues/sitemap-component
```

---

2. Features
-----------

[](#2-features)

This component builds sitemaps supported by the main search engines, Google and Bing, in xml and gzip formats.

The **Sitemap Component** is able of building the following types of sitemaps:

#### Sitemap Index

[](#sitemap-index)

A sitemap that serves as a index containing references to other sitemap.xml files. More documentation can be found [here](https://support.google.com/webmasters/answer/71453?hl=en).

#### Basic Sitemap

[](#basic-sitemap)

Text content sitemaps, the most common type of sitemap found around the Internet. More documentation can be found [here](https://support.google.com/webmasters/answer/183668?hl=en&ref_topic=8476).

#### Image Sitemap

[](#image-sitemap)

Sitemap for for images. More documentation can be found [here](https://support.google.com/webmasters/answer/178636?hl=en).

#### Video Sitemap

[](#video-sitemap)

Sitemap for for videos. More documentation can be found [here](https://support.google.com/webmasters/answer/80472?hl=en&ref_topic=10079).

#### Media Sitemap

[](#media-sitemap)

Alternative for video sitemaps. More documentation can be found [here](https://support.google.com/webmasters/answer/183265?hl=en).

#### News Sitemap

[](#news-sitemap)

Sitemap for news articles. More documentation can be found [here](https://support.google.com/webmasters/answer/74288?hl=en).

#### Standard compilant

[](#standard-compilant)

The sitemap component follow 100% the standards, meaning that it follows strictly the contrains:

- A sitemap file cannot contain **50000 items per file**.
- A sitemap file cannot be larger than **50 MBytes, uncompressed**.
- An Image Sitemap file cannot contain more than **1000 images** per `` element.

---

3. Automatic sitemap submission
-------------------------------

[](#3-automatic-sitemap-submission)

This component also provides a method to submit the generated sitemaps to the following search engines:

- Google
- Bing

---

4. Usage
--------

[](#4-usage)

### 4.1 - Submit to search engines

[](#41---submit-to-search-engines)

```
