Download the PHP package akse1a/seo without Composer
On this page you can find all versions of the php package akse1a/seo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package seo
SEO Library
A PHP library for working with SEO meta tags, Open Graph, Schema.org markup, and sitemap.xml generation.
Installation
Install via Composer:
Or add to your composer.json:
Usage
Basic Usage
Adding Custom Meta Tags
Adding Open Graph Tags
Schema.org Markup
Generating sitemap.xml
Basic Example
Full Example with Error Handling
Output Sitemap Directly to Browser
Parameters for addUrl()
$loc(required) - Page URL (automatically validated)$lastmod(optional) - Last modification date (format: Y-m-d or DateTimeInterface object)$changefreq(optional) - Change frequency: string orChangeFrequencyenum$priority(optional) - Priority from 0.0 to 1.0 (automatically validated)
Duplicate URL Handling
The library automatically prevents duplicate URLs in the sitemap. If you try to add the same URL twice:
- Duplicate URLs are automatically detected using URL normalization (case-insensitive scheme/host, trailing slash handling)
- Existing URL is updated with new parameters if provided (lastmod, changefreq, priority)
- Original parameters are preserved if new ones are not provided
Examples of URLs considered duplicates:
https://example.com/pageandhttps://example.com/page/(trailing slash)https://Example.com/pageandhttps://example.com/page(case difference)http://example.com/pageandhttps://example.com/page(different schemes are NOT considered duplicates)
You can check if a URL exists using:
Error Handling
The library throws exceptions for invalid data:
Example with Multiple Pages
Development
Requirements
- PHP 8.0 or higher
- Composer
Install Dependencies for Development
Run Examples
License
MIT
Author
akse1a
All versions of seo with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.0
The package akse1a/seo contains the following files
Loading the files please wait ...