PHPackages                             ashfaq1701/sitemap-generator - 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. ashfaq1701/sitemap-generator

ActivePackage

ashfaq1701/sitemap-generator
============================

A Basic sitemap generator generated by scraping

v1.0.0(9y ago)330MITPHP

Since Nov 23Pushed 9y ago2 watchersCompare

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

READMEChangelog (1)DependenciesVersions (2)Used By (0)

\#Sitemap Generator

This package is a sitemap generator which generates XML sitemap for any given website dynamically. It generates sitemap by scraping all links from webpages recursively. But I tried to make it efficient by reducing the number of loops in least possible value.

\#Installation

You can install the package using composer.

```
composer require ashfaq1701/sitemap-generator
```

\#Usage

After installation using composer require the composer autoload file.

```
require 'vendor/autoload.php';
```

After this follow the steps below,

```
use Ashfaq1701\SitemapGenerator\SitemapGenerator;

....

$sitemapGenerator = new SitemapGenerator($url, $path, $maximum);
$sitemap->generateSitemap();
```

It will generate the sitemap xml file in the file passed in $path variable. The maximum number of url's in the sitemap will be the number passed in $maximum.

A typical call will be like,

```
$sitemapGenerator = new SitemapGenerator('https://www.venturepact.com', '/home/user/sitemap.xml', 2000);
$sitemap->generateSitemap();
```

The $path and $maximum parameters are not mandatory because they assume default values as $path='sitemap.xml' and $maximum=1000.

The generateSitemap() method not only writes the xml sitemap in the given directory but it also returns the sitemap XML as String. You can use this as following,

```
$sitemapGenerator = new SitemapGenerator('https://www.venturepact.com', '/home/user/sitemap.xml', 2000);
$sitemapText = $sitemap->generateSitemap();
echo $sitemapText;
```

\#Improvements

If you have suggestions or need improvements please create issues or fork. Any improvements are more than welcome.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

Unknown

Total

1

Last Release

3455d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ca630b21f01ee473212d09a13575950e020864ac093a5a6a92fc0c64fdbf4084?d=identicon)[Md Ashfaq Salehin](/maintainers/Md%20Ashfaq%20Salehin)

### Embed Badge

![Health badge](/badges/ashfaq1701-sitemap-generator/health.svg)

```
[![Health](https://phpackages.com/badges/ashfaq1701-sitemap-generator/health.svg)](https://phpackages.com/packages/ashfaq1701-sitemap-generator)
```

PHPackages © 2026

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