Next.js / SEO

Paso 19 de 24

Configure SEO, sitemaps, and Search Console

Give search engines the correct public origin and a reliable way to discover your localized Next.js pages.

Configura el origen HTTPS público del frontend en el entorno de producción. Utilice la URL real del sitio sin una barra diagonal al final; no utilice localhost, un nombre de host de vista previa, el panel Altified o el dominio de la API.

.env.local o entorno de alojamiento
NEXT_PUBLIC_SITE_URL=https://www.example.com

Altified utiliza este valor para el mapa del sitio generado y las rutas de robots, los orígenes de metadatos, las URL canónicas y las URL de idiomas alternativos. Para mapas del sitio XML personalizados o estáticos, establezca ALTIFIED_SITE_URL o NEXT_PUBLIC_SITE_URL explícitamente para que el SDK lea solo el host público previsto.

Mantén el mapa del sitio completo.

Su aplicación ya debe exponer un sitio propiedad de /sitemap.xmlPuede provenir de app/sitemap.js o app/sitemap.tso a partir de un mapa del sitio XML/estático personalizado publicado.

Incluya todas las páginas públicas, incluidas las páginas dinámicas como productos, artículos, empleos o rutas de documentación. Altified utiliza este mapa del sitio como su fuente y no inventa URL que su sitio omita. Si aún no hay un mapa del sitio, cree primero el mapa del sitio propiedad del sitio y luego ejecute altified init.

Ejecutar el inicializador

Cuando existe un mapa del sitio, altified init guarda /sitemap.xml sin cambios y agrega un índice Altified separado en:

Rutas públicas generadas
https://www.example.com/altified-sitemap.xml https://www.example.com/altified-sitemaps/fr-0.xml

El mapa del sitio Altified contiene solo URL de idiomas adicionales. El inicializador también agrega /altified-sitemap.xml a un existente robots.js, robots.ts, o robots.txt cuando pueda identificar el formato de forma segura.

Lea las advertencias del inicializador.

If the initializer cannot update an unusual robots implementation or static file, make the reported manual change. You can also submit the Altified sitemap directly in Google Search Console.

Enviar el mapa del sitio Altified

Después de la implementación, abra la propiedad de Google Search Console para el mismo origen de frontend y envíe el Altified sitemap:

URL del mapa del sitio
https://www.example.com/altified-sitemap.xml

Mantenga el mapa del sitio original enviado o visible también. Enviar el mapa del sitio Altified ayuda a los motores de búsqueda a descubrir las URL traducidas; no reemplaza el mapa del sitio ni agrega hreflang anotaciones por sí mismas.

Verificar antes de publicar

  • NEXT_PUBLIC_SITE_URL matches the deployed frontend origin.
  • The site's /sitemap.xml returns successfully and includes all public dynamic pages.
  • /altified-sitemap.xml returns successfully after target locales and routing are published.
  • The localized child sitemap URLs returned by the index are reachable.
  • robots.js or robots.txt lists both the site sitemap and the Altified sitemap, or the Altified sitemap has been submitted directly in Search Console.
  • Default and translated pages contain reciprocal hreflang links and a self-canonical URL.
  • Translated pages are indexable and actually contain translated content.