# Evitar la descarga de archivos

Este artículo explica cómo evitar la descarga directa de archivos en WordPress, permitiendo el acceso solo a usuarios con roles específicos. La estrategia incluye filtrar archivos por tipo (PDF, ZIP, DOCX, JPG, PNG) y nombre (aquellos que comienzan con "protegido\_"), redirigiendo las solicitudes a través de WordPress para verificar permisos antes de permitir la descarga. Se utiliza una combinación de reglas en el archivo `.htaccess` y código PHP en `functions.php` para implementar esta restricción.

Revise por favor nuestra guía: <https://sitioshispanos.blog/wordpress/wordpress-como-evitar-la-descarga-de-archivos-en-tu-sitio/>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ayuda.sitioshispanos.com/menu-principal/guias/web-hosting/wordpress/seguridad/evitar-la-descarga-de-archivos.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
