# WordPress site URLs: get pages and posts from its sitemaps

**Use case:** 

Enter a WordPress site, or a section such as /blog/, and get the URLs its sitemaps list, such as posts, pages, categories and WooCommerce products, with last-modified dates where listed. This example stops at the first 500 URLs in sitemap order; set Max URLs per run to 0 (no limit) to get them all. Works with WordPress core (wp-sitemap.xml), Yoast SEO and Rank Math, nested indexes and gzip.

## Input

```json
{
  "startUrls": [
    "https://wordpress.org/news/"
  ],
  "maxUrls": 500,
  "maxUrlsPerSite": 0,
  "keepUrlsWithoutLastmod": false,
  "sameSiteOnly": false,
  "onlyNewUrls": false,
  "baselineOnFirstRun": true,
  "includeImageUrls": false,
  "includeAlternates": true,
  "maxSitemapDepth": 5,
  "maxConcurrency": 10,
  "requestTimeoutSecs": 30
}
```

## Output

```json
{
  "url": {
    "label": "URL",
    "format": "string"
  },
  "lastmod": {
    "label": "Last modified",
    "format": "string"
  },
  "changefreq": {
    "label": "Change frequency",
    "format": "string"
  },
  "priority": {
    "label": "Priority",
    "format": "number"
  },
  "imageCount": {
    "label": "Images",
    "format": "integer"
  },
  "sitemapUrl": {
    "label": "Found in sitemap",
    "format": "string"
  },
  "isNew": {
    "label": "New",
    "format": "boolean"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Sitemap Extractor & URL Finder Actor is ready to run with the inputs already set for "WordPress site URLs: get pages and posts from its sitemaps". [Sign up or log in](https://console.apify.com/create-task-from-example/ggXhrCCaCJR9HJUVe) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "WordPress site URLs: get pages and posts from its sitemaps" task

The Sitemap Extractor & URL Finder Actor will start running based on the input automatically. You can also change all the input fields, like websites or sitemap urls, max urls per run, and more, to match your specific use case.

### 3. Receive the "WordPress site URLs: get pages and posts from its sitemaps" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as URL, last modified, change frequency, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "WordPress site URLs: get pages and posts from its sitemaps" task via API](https://apify.com/urameshi7k/sitemap-extractor.md).

## FAQ

### What data does this task return for each URL?

Each URL comes with the sitemap it was first found in, plus the last-modified date, change frequency, priority and image count that sitemap lists. Values the sitemap leaves out are empty (image count 0). With Only new URLs on, items also get isNew.

### How does this task filter URLs?

This task sets no pattern, date or sitemap filters. It keeps only URLs under https://wordpress.org/news/ (the start URL's path) and stops at 500. You can add include or exclude patterns and date limits, or choose which sitemaps to read.

### What types of sitemaps can this task read?

The task can read various sitemap formats including XML, gzip, plain text, RSS, and Atom feeds.

### Can this task automatically discover sitemaps?

The task automatically discovers sitemaps by checking the robots.txt file and common sitemap locations if none are listed.

### What is the purpose of the 'isNew' field in the output?

isNew appears only when Only new URLs is on. With First run only saves a baseline on, as here, the first such run returns nothing and only saves the URLs. Each later run returns the URLs missing from the list the previous run saved, marked isNew.

### Can this task be scheduled to run automatically?

Yes, in Apify Console. To monitor a site, also turn on Only new URLs: the first run saves a baseline, then each later run returns only URLs added since the previous one. With it off, as here, each run returns and charges for the first 500 URLs again.

### Is there a limit on the number of URLs this task can retrieve?

The task is configured to retrieve a maximum of 500 URLs as specified in the task input.

## About this Actor

This example demonstrates how to use [Sitemap Extractor & URL Finder](https://apify.com/urameshi7k/sitemap-extractor.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/urameshi7k/sitemap-extractor.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/urameshi7k/sitemap-extractor.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
