Skip to content

feat: add proxied sitemap example #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 17, 2025
Merged

Conversation

theodesp
Copy link
Member

@theodesp theodesp commented Apr 8, 2025

Description

This PR implements a solution for integrating WordPress XML sitemaps with a Next.js frontend. It allows WordPress sitemaps to be fetched, transformed, and proxied to a Next.js frontend. The domain replacement is handled by a custom WordPress plugin, which automatically adjusts the URLs before serving them through the Next.js application.

Reference

#48

Type of Change

✨ New feature (non-breaking change which adds functionality)

How Has This Been Tested?

The changes have been tested by:

  • Setting up the WordPress environment with XML sitemaps enabled and the custom plugin for replacing domain URLs.

  • Configuring a Next.js project to proxy and transform the sitemaps using the provided API route.

  • Verifying that requests for /sitemap.xml and specific sitemaps (e.g., /wp-sitemap-posts-post-1.xml) return the correctly transformed XML, with URLs pointing to the frontend domain (FRONTEND_URL).

  • Testing in both local development (with FRONTEND_URL set to http://localhost:3000) and a custom environment by overriding the FRONTEND_URL.

@theodesp theodesp requested a review from a team as a code owner April 8, 2025 14:22
@whoami-pwd whoami-pwd self-requested a review April 8, 2025 14:35
josephfusco
josephfusco previously approved these changes Apr 10, 2025
Copy link
Member

@josephfusco josephfusco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @theodesp!

@ahuseyn ahuseyn self-requested a review April 11, 2025 09:45
Copy link
Member

@ahuseyn ahuseyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great example @theodesp. I've suggested two readme changes. Also FYI, when I've built the example, Custom Sitemap URL Adjustment (MU) was deactivated by default.

@theodesp theodesp requested review from ahuseyn and josephfusco April 15, 2025 09:25
ahuseyn
ahuseyn previously approved these changes Apr 15, 2025
colinmurphy
colinmurphy previously approved these changes Apr 15, 2025
Copy link
Member

@colinmurphy colinmurphy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@theodesp

LGTM 🚀 🚀 🚀

Added one minor suggestion for the README.

@theodesp theodesp dismissed stale reviews from colinmurphy and ahuseyn via 91b0d3d April 16, 2025 09:49
@theodesp theodesp requested review from colinmurphy and ahuseyn April 16, 2025 09:51
@theodesp theodesp enabled auto-merge April 17, 2025 09:08
@theodesp theodesp added this pull request to the merge queue Apr 17, 2025
Merged via the queue into main with commit 1989cda Apr 17, 2025
1 check passed
@theodesp theodesp deleted the example-proxied-sitemaps-next branch April 17, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants