Hi folks. How can I find out what links are connected for internal links in a website. I want to rename a page but want all internal links to point to that new page.
Thanks.
:)
Printable View
Hi folks. How can I find out what links are connected for internal links in a website. I want to rename a page but want all internal links to point to that new page.
Thanks.
:)
I am pretty sure if you change a page name the link automatically changes. Give it a try.
behzad, your ask is very ambiguous. You seem to be implying all internal links to go to a completely new page (and location).
If you have used Link to links then your XDA recalculates any changes when you change the current page name to another (what Gary P said).
Ditto for changes to Anchors, Headings and Smart Fields. [Page name change Help --> Support]
If you have added links manually as in Link to Web or Email address then these have to be manually changed. [Link change help.htm --> support.htm]
Your XDA has no search & replace capability for links.
To change [Link old location --> new location], I would Preview the page and open Browser > Developer Tools > Console and paste in the following:
This creates a listing of all links.Code:var x = document.querySelectorAll("a");
var myarray = []
for (var i=0; i<x.length; i++){
var nametext = x[i].textContent;
var cleantext = nametext.replace(/\s+/g, ' ').trim();
var cleanlink = x[i].href;
myarray.push([cleantext,cleanlink]);
};
function make_table() {
var table = '<table><thead><th>Name</th><th>Links</th></thead><tbody>';
for (var i=0; i<myarray.length; i++) {
table += '<tr><td>'+ myarray[i][0] + '</td><td>'+myarray[i][1]+'</td></tr>';
};
var w = window.open("");
w.document.write(table);
}
make_table()
You can then check the internal ones to see what you need to alter in the design.
Acorn
Thank you Both. I used an existing page and renamed it and it did it automatically. For assistance I used google search console/links/internal links.
Acorn how did you learn coding?