Recommend this page to a friend! |
Download .zip |
Info | Example | View files (9) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2023-10-05 (3 months ago) | Not yet rated by the users | Total: 54 This week: 1 | All time: 10,514 This week: 108 |
Version | License | PHP version | Categories | |||
simplesitemapgenerat 1.0 | Custom (specified... | 5 | XML, PHP 5, Tools, Files and Folders, T... |
Description | Author | |||||||||||||
This package can generate XML and text sitemaps from lists of pages. |
|
This is a PHP utility for generating a SiteMap.
The generation can be as easy as providing a list of files with a base URL (see example1) or, more complex, giving individual options for different files (see example2).
The generated file can be either in XML or TXT format.
The generated file can be used for indexing a website in a search engine, such as Google.
For more details about the file format, see [https://sitemaps.org/protocol.html].
Its primary intended usage is for generating sitemaps for static Web sites. You pass an array of file paths and get a sitemap file generated in the specified destination path.
The generation process will assign a different change frequency and priority to index files.
However, the generation process can be fully controlled by passing a detailed array of options to the generation process, as detailed below.
Take a look at the examples folder for different usage scenarios.
<?php |
This is a PHP utility for generating a SiteMap. Generation can be as easy as providing a list of files with a base URL (see example1) or more complex, providing individual options for different files (see example2). The generated file can be either in XML or TXT format. The generated file can be used for indexing a website in a search engine, such as Google. For more details about the file format see: https://sitemaps.org/protocol.html .
Its primary intended usage is for generating sitemaps for static websites. You pass an array of file paths and get a sitemap file generated in the specified destination path. The generation process will assign a different change frequency and priority to index files. However, the generation process can be fully controlled by passing a detailed array of options to the generation process, as detailed below. Take a look at the examples folder for different usage scenarios.
This method will generate a sitemap file in XML format. The "pages" argument is an array with the pages to be included in the sitemap. Each entry contains either: - a) a string representing the page (file on the file system or a complete http(s) URL) - b) an array containing some or all of the following (missing elements are replaced with default values): - _page_ is the file or URL - _lastmod_ is the last modification string to be included in the sitemap - _changefreq_ is the change frequency string to be included in the sitemap - _priority_ is the priority string to be included in the sitemap
This method will generate a sitemap file in TXT format. The "pages" argument is an array with the pages to be included in the sitemap, similar to the _generateSiteMapXML_ method. Since the TXT sitemap contains only URLs, other options such as _lastmod_, _changefreq_, and _priority_ are ignored.
Sets the base URL of the website. This will be used to generate URLs from file names. Example: _setBaseURL("https://mywebsite")_.
Sets the destination folder location for the generated sitemap(s). This is checked and removed from file names if present. Example: _setDestinationPath("..")_.
Sets the default update frequency of files. This will be used in the XML sitemap. Example: _setDefaultChangeFreq("monthly")_.
Sets the default priority of files. This will be used in the XML sitemap. Example: _setDefaultPriority("0.5")_.
Sets the default update frequency of files containing the word "index" in the file name. This will be used in the XML sitemap. Example: _setDefaultChangeFreqIndex("weekly")_.
Sets the default priority of files containing the word "index" in the file name. This will be used in the XML sitemap. Example: _setDefaultPriorityIndex("0.8")_.
Checkout my YouTube channel for interesting videos: https://www.youtube.com/@ComputingMongoose/
Checkout my website: https://ComputingMongoose.github.io
Files |
File | Role | Description | ||
---|---|---|---|---|
examples (2 directories) | ||||
LICENSE | Lic. | License text | ||
README.md | Doc. | Documentation | ||
SimpleSiteMapGenerator.php | Class | Class source |
Files | / | examples | / | example1 |
File | Role | Description |
---|---|---|
example1.php | Example | Example script |
sitemap.txt | Output | Site URLs list |
sitemap.xml | Output | XML Sitemap |
Files | / | examples | / | example2 |
File | Role | Description |
---|---|---|
example2.php | Example | Example script |
sitemap.txt | Output | Site URLs list |
sitemap.xml | Output | XML sitemap |
simplesitemapgenerat-2023-10-05.zip 5KB | |
simplesitemapgenerat-2023-10-05.tar.gz 3KB | |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.
Related pages |
SimpleSiteMapGenerator on my website |