question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't remove deleted pages from search or "current" URL

See original GitHub issue

šŸ› Bug Report

Have you read the Contributing Guidelines on issues?

Yes, I highly recommend them

To Reproduce

  1. Follow https://docusaurus.io/docs/en/installation to make a new docusaurus v1 project
  2. cd website
  3. yarn examples versions
  4. yarn run version 1.0.0
  5. Delete docs/doc3.md file and delete "Second Category": ["doc3"] from sidebars.json
  6. yarn run version 2.0.0
  7. yarn start
  8. View the website in a browser, and see that /docs/doc3 still resolves to the version 1.0.0 file in a browser even though it doesn’t appear in the sidebar.
  9. If you can set up algolia, see that you can still get to the ā€œcurrentā€ URL that way, too.

Expected and Actual behavior

When I delete a markdown file from the main docs folder and remove it from the sidebar, I would expect it to be inaccessible from the ā€œcurrentā€ version.

But it continues to be returned by Algolia DocSearch, which can be clicked and the /docs/<id> does actually load correctly because of versioning fallback. This makes it appear as though that page still exists when it in fact does not.

Possible Solutions

Maybe the version command should be creating an empty markdown file in a versioned_docs folder for every file that is no longer in /docs?

Or maybe it can be solved manually with an array of doc IDs that should no longer be accessible?

Or if there isn’t a clear solution to the problem of the page being accessible, it should at least not appear in Algolia results so that nothing links to it.

Your Environment

  • Docusaurus version used: 1.14.4
  • Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0):
    • Chrome 80.0.3987.132 (Official Build) (64-bit)
    • Node 8
  • Operating system and version (desktop or mobile): MacOS Catalina, desktop

Reproducible Demo

https://github.com/aldeed/docusaurus-versioning-issue

This repo followed the reproduction steps above so you only need to clone it, yarn install, and then start with the yarn start step.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
aldeedcommented, Jun 17, 2020

Thanks @slorber. There are no pages to delete. The problem is the fallback behavior so fixing it would involve deleting pages from previous versions, which is not what we want. We DO want the pages visible when viewing an old version (which has them in TOC) but we DO NOT want them visible when you search the current version or go directly to that ID URL in the current version. I’ll see if I can figure out any easy way to circumvent the fallback from a list of IDs.

EDIT: Nevermind, I think I see what you are saying. Delete all the files/folders after the last version in which the content was correct. That would work, but it’s quite a lot to delete. Need to delete from every subsequent version plus the current. If I can figure out how to not generate those in the first place, that will be a much quicker build.

0reactions
aldeedcommented, Jun 17, 2020

@yangshun @slorber I have a PR with a possible solution that works well for me. https://github.com/facebook/docusaurus/pull/2955

Read more comments on GitHub >

github_iconTop Results From Across the Web

Removals and SafeSearch reports Tool - Search Console Help
The Removals tool enables you to temporarily block pages from Google Search results on sites that you own, see a history of removal...
Read more >
How to properly delete a page from your site - Yoast
Want to delete a page from your site? This post explains the options you have when deleting a page and helps you choose...
Read more >
URL removal explained, Part III: Removing content that you ...
Only the current updated page (without the content that's been removed) will be accessible from Google's search results. However, the current updated page...
Read more >
What to Do When Google Still Shows Old Website Pages in a ...
Prerequisite: Google Search Console Ā· Delete or Redirect the Page in Question Ā· Request URL Removal from GSE.
Read more >
If a page has already been removed on a site, why does it still ...
Google Search Console's Removal Tools: works usually within 24 hours, but often times much faster. Caveat: this only hides URLs for 180 days....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found