Mobile app version of vmapp.org
Login or Join
Dunderdale272

: Rel="prev" and rel="next" inserting using javascript does adding the rel="next" tag after the page is loaded with a small javascript still useful for SEO and google? i have a problem in my code,

@Dunderdale272

Posted in: #Googlebot #Rel #Seo

does adding the rel="next" tag after the page is loaded with a small javascript still useful for SEO and google?

i have a problem in my code, basically the total number of pages in the catalog is calculated near the end of the code. the only way i could check that i'm in the last page is first to load everything else, but at that point i wouldn't be able anymore to write in the header with php.
how can i solve this?
i thought about a javascript that writes in the header at the end if it is not the last page, OR a javascript that removes the same thing if it is the last page, but i don't know if this would work for google....

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Dunderdale272

1 Comments

Sorted by latest first Latest Oldest Best

 

@Candy875

You could use Javascript to modify the head, but as search engines don't generally run Javascript that wouldn't work. What you probably want to do is PHP output buffering as described in the accepted answer to this question. By the time you get to the end of the page you know what needs to go in the head. Then you can output the head and release everything stored in the buffer.

I've never used output buffering myself, but it looks like it does what you want.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme