• Saltar a la navegación principal
  • Saltar al contenido principal
  • Saltar al pie de página
labarta

Labarta

  • Blog
  • Vídeos Docker
  • Vídeos entrevistas
  • Dominios
  • Hosting
  • Quién soy

Otra forma de hacer redirecciones en WordPress

12/09/2018

redireccion-301

 

Otra forma de hacer redirecciones en WordPress

 

Otra forma de hacer redirecciones en WordPress sin plugins y sin tener que usar .htaccess (por el motivo que sea, a veces no lo puedes usar o no te atreves a tocar código ó tu web no funciona con apache y usa nginx).

Vamos a ver si  explico de forma comprensible esta otra forma de hacer redirecciones en WordPress.

 

pagina-antigua

 

Editamos la página ó post antiguo (en este caso Página de ejemplo) que queremos redirigir al sitio nuevo tenemos que poner esta línea de código haciendo primero clic en la pestaña HTML del editor: 

Hay que poner el slug de la nueva página o post (en este caso Página de ejemplo nueva).


<body onload="location.href='/pagina-de-ejemplo-nueva/'">

 

Y eliminar el todo el resto de contenido que teníamos.

 

script

 

Si lo que queremos es redirigir a otro sitio web el código sería:

 

<body onload="location.href='https://nuevaweb.com/pagina-de-ejemplo-nueva/'">

 

Si la antigua página estaba en el menú, habrá que borrarla del menú y añadir la nueva. Pero tanto si la antigua es una página o un post no eliminar ni enviar a la papelera.

 

pagina-nueva

 

Ahora cuando cualquier visitante pulse sobre el link de la página ( o post) antigua se abrirá esta pero inmediatamente será redirigido a la nueva.

De esta forma evitamos tener un error 404 y al mismo tiempo aprovechar el posicionamiento que ya teníamos en Google.

Espero que me haya explicado y que te sirva esta otra forma de hacer redirecciones en WordPress. 

 

Si lo prefieres también puedes hacerlo con el plugin   "Redirection"  que está disponible en el directorio de WP.


Blog,  Es wordpress

  • Todas las entradas
  • Github
  • Meetup WordPress
  • Política de cookies

Footer

GINERNET - Servidor VPS

Ginernet

GeneratePress - Tema WordPress

GeneratePress

GINERNET - Hosting WordPress

Ginernet2

OnlyOffice - Online Office

Usamos ONLYOFFICE Online Office

Copyright © 2025 · Labarta - Powered by : Labarta

Usamos cookies en nuestro sitio web para brindarle la experiencia más relevante recordando sus preferencias y visitas repetidas. Al hacer clic en “Aceptar todo”, acepta el uso de todas las cookies. Sin embargo, puede visitar "Configuración cookies" para proporcionar un consentimiento controlado.
Configuración cookiesAceptar todo
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Siempre activado
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDuraciónDescripción
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
GUARDAR Y ACEPTAR