My website relies extensively on dynamic pages, particularly to cast a wide net to get search results. The problem is that the Google Crawler (and Ahrefs) are not detecting any of the dynamic pages by the href links I'm placing on the (All) dynamic page - just via the sitemap.
I've done a lot to try to make my (All) pages build referring links to the (Title) pages, but nothing seems to work. Here is the code on my (All) page:
import wixData from 'wix-data';
import wixLocation from 'wix-location';
$w.onReady(function () {
// Write your JavaScript here
let now = new Date();
let today = new Date(now.getFullYear(), now.getMonth(), now.getUTCDate(), 0, 0, 0)
let oneMonth = new Date();
oneMonth.setDate(today.getDate() + 31)
###1
wixData.query("Items1")
.gt("end", today)
.ne("dummy",true)
.lt("when", oneMonth)
.limit(200)
.ascending('when')
.find()
.then((results) => {
$w("#listRepeater").data = results.items
})
$w('#listRepeater').onItemReady(($item, itemData, index) => {
$item('#image').fitMode = "fit";
$item('#image').src = itemData.photo;
$item('#image').link = itemData['link-items-1-title']
$item('#text9').text = itemData.name
$item('#text1').text = itemData.title
###2
var link = $item('#text10').html
link = link.replace("<a>", `<a href="${itemData['link-items-1-title']}">`)
$item('#text10').html = link
$item('#container1').onClick(() => {wixLocation.to(itemData['link-items-1-title'])})
$item('#text8').text = itemData.soldOut == true ? "SOLD OUT" : itemData.cost
});
});
Several things are going on here, all of which are workarounds Wix has forced me into. The most relevant things are:
###1) I have to do my own query via the Wix Data API so that I can only show future events (I have a separate page for past events). This is done on top of the query the dynamic page is already doing.
###2) I am building my own link because Wix's dynamic pages don't seem to let you link to pages dynamically without changing their text.
If you use a tool like the MozBar plugin, all of these links are highlighted as valid, but that seems to be after all JavaScript has executed. Google Search console and Ahrefs are not seeing these dynamically created links, possibly because of execution time, possibly for some other reason.
As a result, my Ahrefs score is garbage, and my performance with Google is below what it should be.
All ideas on how to improve this are welcome :)
If you are facing issues in your internet or having troubles to change the settings of your ISP, then do check out: https://ispsettings.co/