Skip to content
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

Sitemaps.xml breaks upon updates made in RankMath #1885

Open
1 task done
ariel-integrity opened this issue May 10, 2024 · 7 comments
Open
1 task done

Sitemaps.xml breaks upon updates made in RankMath #1885

ariel-integrity opened this issue May 10, 2024 · 7 comments
Assignees
Labels
compatibility with other tools needs: reproduction This issue needs to be reproduced independently type: bug Issue that causes incorrect or unexpected behavior

Comments

@ariel-integrity
Copy link

Description

I'm using the suggested solution in the faust.js docs to create a sitemap for my headless site.

The only issue I've had is that when I make sitemap updates in the RankMath settings, it breaks my CPT sitemaps.

However, if I turn the faust.js plugin off, clear cache, and turn it back on, they work. But in the meantime, I get errors on pages due to faust.js being turned off. Need a solution where I can skip that step.

Steps to reproduce

Set up a sitemaps.xml doc in a faust.js project.

Install RankMath and turn on the sitemap generator. Update the settings to include/not include a CPT.

See that those sitemaps, and maybe the posts/pages, break. Turn off faust.js, clear cache, and turn it back on. They work!

Additional context

Site is up in an Atlas environment.

@faustwp/core Version

1.2.0

@faustwp/cli Version

1.2.1

FaustWP Plugin Version

1.2.3

WordPress Version

6.5.2

Additional environment details

No response

Please confirm that you have searched existing issues in the repo.

  • Yes
@theodesp theodesp added good first issue Issue that doesn't require previous experience with codebase help wanted labels May 13, 2024
@ChrisWiegman
Copy link
Contributor

Hello @ariel-integrity!

My apologies for the late reply here. I've attempted to reproduce the issue with the free version of Rankmath and have been unable to do so.

A few things you might want to check:

  1. Verify the front-end URL env variable is set correctly in sitemap.xml.js.
  2. Ensure your permalinks are not set to Plain.

Can you please verify for me that your sitemap is still broken with the above settings?

@ChrisWiegman ChrisWiegman added the needs: author response Pending information from the author label May 29, 2024
@ChrisWiegman ChrisWiegman removed their assignment Jun 25, 2024
@ariel-integrity
Copy link
Author

@ChrisWiegman Sorry for the late reply. I am facing this issue once again, but have very much narrowed it down.

My sitemaps only seem to break when I add a new post or custom post type post. Other than that, they work correctly and as expected based on the faust.js sitemaps documentation.

I have an example up and running on our dev DB - let me know if there is a secure way to send it to you.

In regards to front-end URL and permalinks:
My front-end URL is correctly set, and I am able to verify this, because the vast majority of sitemaps and links are all correct the vast majority of the time.
My permalinks are set to custom.

@josephfusco
Copy link
Member

Hey @ariel-integrity,

Could you please clarify what you mean by “the sitemap breaks”? For example, is it producing invalid XML, are you getting a 404 error, or something else? The more details you can provide, the better we’ll be able to assist you.


Just a heads-up, ChrisWiegman is no longer working on this project.

@josephfusco josephfusco removed good first issue Issue that doesn't require previous experience with codebase help wanted labels Aug 15, 2024
@ariel-integrity
Copy link
Author

@josephfusco Thanks for the quick update.

In regards to the specific sitemap error, I get a connection timeout. Never loads.

@josephfusco
Copy link
Member

josephfusco commented Aug 20, 2024

Hey @ariel-integrity, just wanted to provide an update that I have a proposed solution available here. I was able to test it using RankMath and it seems like a viable solution. Would love to know your thoughts if you're willing & able test it out!

I will update this issue once a new release is cut for @faustwp/core. 🙌🏼

@josephfusco josephfusco added close candidate Needs confirmation before closing and removed needs: author response Pending information from the author labels Aug 27, 2024
@josephfusco
Copy link
Member

josephfusco commented Aug 27, 2024

Hey @ariel-integrity, a new version of @faustwp/core has been released containing the new configuration option! 🎉

Steps to resolve a broken sitemap when using RankMath sitemaps

  1. Update to @faustwp/[email protected]
  2. Update the sitemap.xml.js to use the new option, which might look something like this:
    import { getSitemapProps } from '@faustwp/core';
    
    export default function Sitemap() {}
    
    export function getServerSideProps(ctx) {
       return getSitemapProps(ctx, {
         sitemapIndexPath: '/sitemap_index.xml', // <-- Use the RankMath sitemap path
         frontendUrl: process.env.NEXT_PUBLIC_SITE_URL,
      });
    }
  3. If the sitemap index path defined above is available, Faust.js sitemaps should start working again in your Next.js site.

@ariel-integrity
Copy link
Author

Hi @josephfusco Thanks so much for your work on this!

I had a chance to implement it on my site at sitemap_index.xml.

I have an issue now where the child maps are listed as:
https://www.url.com/sitemap.xml?sitemap=category-sitemap.xml

instead of
https://www.url.com/sitemap_index.xml?sitemap=category-sitemap.xml,
which is where they now live.

Any chance you are able to recreate and help me solve?

Thanks,
Ariel

@josephfusco josephfusco added type: bug Issue that causes incorrect or unexpected behavior needs: reproduction This issue needs to be reproduced independently and removed close candidate Needs confirmation before closing labels Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility with other tools needs: reproduction This issue needs to be reproduced independently type: bug Issue that causes incorrect or unexpected behavior
Projects
None yet
Development

No branches or pull requests

4 participants