I'm a php programmer and I'm in the middle of a a new project that creates websites' sitemap
to create sitemap we set a propriety level for every link on the site the priority decreases if the link is away deeper and away from the home page the idea is that:
- if the link 1 level away priority will be 1
- if the link 2 levels away priority will be 0.80
- if the link 3 levels away priority will be 0.75
- if the link 4 levels away priority will be 0.64
the priority levels i mention are just for illustration all i need is a simple formula to decrease the priority while the link level increases
i have created a function in the PHP language uses the following simple formula
$priority = 1-.120*page level ;
if the deep level is 1 the priority will be 0.88
if the deep level is 5 the priority will be 0.40
and to avoid the priority reach less than .20
i asked the function to assign the value .20 if the formula gives me a value less than that
it's very rare for a link to be away deeper than 7
the complete php function