• Resolved petitshoo

    (@petitshoo)


    Hi,

    I’m setting up linker to track some redirects and would like to remove the /go/. The FAQs just say to use the linker_prefix_slug?filter. But not how to use that filter. Please help.

    Thanks,
    Jen

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Yakir Sitbon

    (@kingyes)

    Hello @petitshoo

    It’s a really simple filter, and here’s how to use it:

    add_filter( 'linker_prefix_slug', function( $slug ) {
    return 'what-you-want-return';
    } );

    Keep in mind, after applying your code, go to the Permalink settings page and reapply the settings.

    Thread Starter petitshoo

    (@petitshoo)

    Thank you! Is there a way to remove having anything before the link altogether? For instance instead of url.com/go/link It would be just url.com/link?

    We have been using a “page links to” plugin to forward shortened links off site and want to be able to track those. We have the links already on printed pieces and would like to not have that link change.

    Thanks!
    Jen

    Plugin Author Yakir Sitbon

    (@kingyes)

    You can use the linker as a post post type. To do so, use the following code:

    add_filter( 'linker_post_type_slug', function ( $cpt ) {
    return 'post';
    } );

    add_filter( 'linker_skip_register_post_type', '__return_true' );

    Good luck.

    Thread Starter petitshoo

    (@petitshoo)

    When I use those filters, the Linker plugin no longer shows up in the sidebar for me to be able to add links. And when I put the Linker page in a separate tab before adding the filters I’m getting an “Invalid Post type” when I refresh that page.

    Plugin Author Yakir Sitbon

    (@kingyes)

    The linker will change your posts to Linker. But the way, it’s still good to save the Permalink again.

    Thread Starter petitshoo

    (@petitshoo)

    Hi again, I have figured out a workaround for this issue. I can have my redirect go to the linker page link and then that will go to the actual redirect and I can have my counts. Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.