esc_url for links

Do I need to use esc_url ( the_permalinks() ); ?

( it is the_permalink() not the_permalinks() )

If you are using the_permalink() then you do not need to use esc_url. the_permalink() echos the link to the page and already passes that through esc_url. It’s actually not possible to use esc_url with the_permalink, it just wont work.

So you should use this:

test

or this:

test
1 Like

esc_url( the_permalink()); works but I get always soft reject because of escape all links so I even esc the_permalinks … but still they send me 1.Please check if every xxx are properly escaped and you use esc_url.

esc_url( the_permalink());

is not valid code. it has to be this:

echo esc_url( get_the_permalink());

ok I remove esc_url( the_permalink() );