Hello,
I use Easy Layouts 1.7.27 on Joomla 6 with the float/isotope layout for com_content category blogs, and I'd like to report an SEO problem with how the prefetched items are output.
What happens
`administrator/components/com_easylayouts/output/com_content/float_items.php` builds the HTML of the articles and puts it into the page as an inline script:
Because of `json_encode()`, the item HTML in the page source looks like this:
Googlebot scans inline scripts for URLs and picks up these escaped strings. It treats the backslashes as slashes and keeps the escaped quotes, so it requests URLs like:
These all return 404. Google Search Console currently shows 306 such URLs on my site, about 80% of all my 404 reports, and the number keeps growing as new articles are added.
A simple fix
I patched the file locally to output the same JSON base64-encoded. Google no longer sees anything that looks like a link, and the browser gets exactly the same data:
The JSON response for `json=1` requests is unchanged, so `floatItems.js` works as before. Using `JSON_UNESCAPED_SLASHES` alone would not be enough, because the escaped quotes (`\"`) would still produce invalid URLs.
A related suggestion
At the moment the `.elsiso_container` is sent empty and every item is inserted by JavaScript. Search engines therefore see the article links only after rendering the page. It would help SEO a lot if the first batch of items were rendered directly as HTML inside the container, with only the "load more" items coming from JSON.
I'd be grateful if you could include a fix in a future release, so I don't have to reapply my patch after every update. I'm happy to test a development build.
Thank you for your work on Easy Layouts.
Best regards.
I use Easy Layouts 1.7.27 on Joomla 6 with the float/isotope layout for com_content category blogs, and I'd like to report an SEO problem with how the prefetched items are output.
What happens
`administrator/components/com_easylayouts/output/com_content/float_items.php` builds the HTML of the articles and puts it into the page as an inline script:
$prefetchedData = json_encode($returnData); // line 192
...
var prefetchedData = $prefetchedData; // line 281Because of `json_encode()`, the item HTML in the page source looks like this:
<a href=\"\/aktivity\/skatepark-v-unicove\">Googlebot scans inline scripts for URLs and picks up these escaped strings. It treats the backslashes as slashes and keeps the escaped quotes, so it requests URLs like:
https://www.brouzdak.cz/"//aktivity//skatepark-v-unicove/"These all return 404. Google Search Console currently shows 306 such URLs on my site, about 80% of all my 404 reports, and the number keeps growing as new articles are added.
A simple fix
I patched the file locally to output the same JSON base64-encoded. Google no longer sees anything that looks like a link, and the browser gets exactly the same data:
$prefetchedData = json_encode($returnData);
$prefetchedJs = 'JSON.parse(new TextDecoder().decode(Uint8Array.from(atob("' . base64_encode($prefetchedData) . '"),function(c){return c.charCodeAt(0);})))';
...
var prefetchedData = $prefetchedJs;
The JSON response for `json=1` requests is unchanged, so `floatItems.js` works as before. Using `JSON_UNESCAPED_SLASHES` alone would not be enough, because the escaped quotes (`\"`) would still produce invalid URLs.
A related suggestion
At the moment the `.elsiso_container` is sent empty and every item is inserted by JavaScript. Search engines therefore see the article links only after rendering the page. It would help SEO a lot if the first batch of items were rendered directly as HTML inside the container, with only the "load more" items coming from JSON.
I'd be grateful if you could include a fix in a future release, so I don't have to reapply my patch after every update. I'm happy to test a development build.
Thank you for your work on Easy Layouts.
Best regards.