Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is there someway to get a list of all links on a page, including links in theme files, header, footer, sidebar, posts, etc?

It is possible to do this in JavaScript, but I'm hoping for a server-side solution.

share|improve this question

1 Answer 1

it is possible to do on server side but you would have to create an output buffer and the either use Regex or Dom phrase to get all of the links. a much easier solution would be to use JavaScript or even better jQuery.

share|improve this answer
    
Agreed, JS/jQuery is definately the favorable approach here. –  t31os Aug 6 '11 at 11:00
    
I have a jQuery solution working at the moment, where I pass some links to the server with jquery.post(), get a new list of links as a response, and then modify the page. The major downside is there is no caching of these ajax requests. Is it possible to get this working to cache these requests with WP super cache? –  jess Aug 10 '11 at 15:37
    
Not really caching but you can save the links in the database before you return your respond, and next time just call that saved data. –  Bainternet Aug 10 '11 at 18:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.