Skip link - remove link & scripts

It seems that Cwicly automatically creates a skip link.

Is there a way to disable this behaviour?

What if I don’t want it / or what if I want to create my own?

Associated with this skip link, if we would be given the flexibility to remove it, these should be also removed:

  1. There is inline style loaded with the id=“skip-link-styles”.
  2. There is a inline script that searches for the “main” id.

Hello @Dev.tomi,

This is not created by Cwicly, but an automatic addition by WordPress which we have slightly modified.

You can remove it easily.

You can use the cc_skip_link filter hook simply returning a value other than null which will cancel the skip link print.

Thanks @Louis,

could you please provide an example code to remove WP native skip link function?

Sure!
This is more specific to Cwicly as we modify the position of the native WordPress skip link and add our own filter hook.

/**
 * Determines whether to skip the specified link.
 */
add_filter('cc_skip_link', 'skip_link_filter');

/**
 * Filter callback function to skip the link.
 *
 * @return bool Returns true to skip the link.
 */
function skip_link_filter()
{
    return true;
}
2 Likes

Perfect, thank you!

Working very well.