Forgive me if this has already been addressed, I searched for it but couldn't find a similar issue. I'm using the file entity module and it automatically generates a page for each of the files. This causes SEO problems (Not sure how the crawler is finding them) because the pages arn't setup for it. I would really like to just eliminate the pages from show up. Does anyone know how to pull this off?
-
Do you want to keep the old files on the system? You can always edit your robots.txt to exclude certain path patterns from being indexed by search engines. Is there a special Content type File on your system?– prkosCommented Feb 26, 2019 at 16:17
-
I want to keep all files on the system. The goal is not to remove the files themselves. Its to remove the file's pages. Below is an example of what I am talking about. example: ehe.osu.edu/file/cover-letter-guidepdf– themantimeforgotCommented Feb 28, 2019 at 14:33
1 Answer
AFAICT the File entity module is all about adding the feature how to handle files by creating entities and their pages. If you delete the page, you also delete the file.
Is there any reason why you're using this module? Maybe you don't even need it?
If you disable and uninstall the module the files will remain, although you should test this first before applying to the main site (backup everything first, although backups are a must either way).
Have you tried view files
Permission? Maybe you can restrict viewing the pages, while the files may be available through a reference on Content types.
Add this to your robots.txt to make the search engines not index these pages:
# Custom - added on Feb 28 2019
Disallow: /file/
-
We are using the media module which requires the File Entity module. I haven't tried the view files permission but I'll check it out, see if that does what I need to. I want to keep the files for analytics purposes. Maybe:
# Custom - added on Feb 28 2019 Disallow: /file/ Allow: /file/*.*
Commented Feb 28, 2019 at 20:04 -
The file links are probably something like
/sites/default/files/filename.pdf
so you should disallow the entire/file/
, the files should be indexed through the pages where they're attached. Don't forget to check which useragent you're adding your changes under ;)– prkosCommented Feb 28, 2019 at 21:00