Exclude just a keyword from a post for auto links

I have a keyword to redirect to a post. That keyword is placed on the content of that post too. With regular behavior of the plugin, the auto link for that keyword is redirecting to the post itself.

Since there are other keywords on the post that are redirecting to other posts, I would like that concrete keyword to be excluded ONLY for that post (if excluding the post, the other keywords are automatically disabled as well).

Would this be possible?

  • Ari
    • Recruit

    Hey Danny

    Hope you are well today!

    With regular behavior of the plugin

    There are two ways you can set the link for redirection:
    1: Absolute URL, like: http://domain.com/post-one
    2: Relative Path, like: /post-one

    1: If you set absolute URL for a keyword, and if that keyword's link get matched with current URL, plugin should exclude that keyword automatically.

    2: But if you set relative path, plugin doesn't exclude it either link get matched with current URL or not.
    ( I think this is an issue, plugin should exclude that keyword too if the link get matched with current URL ).

    I saw you didn't set Absolute URL, but Relative Path, that's why it's not working.
    But yesterday I set Absolute URL in a post in your site, and unfortunately this is also not working! but it is working fine in my test sites!

    ====

    So, with Absolute URL, as I replicated the issue only in your site, I need to do some debug in your site, as well as conflict test too!

    === What is conflict test? ===

    Basically I'll disable all plugins temporarily to confirm no plugin causing this issue, also I'll switch to a default twenty seventeen theme temporarily!

    About Relative path, I'll do a quick fix for it and let you know!

    So, for further testing can you please send me your FTP details through our secure contact from: https://premium.wpmudev.org/contact/#i-have-a-different-question
    Using the below template:

    Subject: "Attn: Ari"
    - WordPress admin (login url/username/password)
    - FTP credentials (host/username/password)
    - cPanel/Plesk credentials (host/username/password)
    - link back to this thread for reference (it is: https://premium.wpmudev.org/forums/topic/exclude-just-a-keyword-from-a-post-for-auto-links)
    - any other relevant urls

    Keep in mind the subject line as ensures that it gets assigned to me.

    Have a great day!
    Warm Regards,
    Ari

  • Ari
    • Recruit

    Hey Danny

    Hope you had a good day!

    I made a fix for this by changing a plugin's file, please replace this file: plugins/wpmu-dev-seo/includes/tools/autolinks.php with the attached one, make sure you unzipped the attached file first!

    If that not solve your issue, please send me the FTP credentials as I said above!

    Please let me know here, how it goes!

    Best Regards,
    Ari

  • Ari
    • Recruit

    Hey Danny

    I just removed the plugin, and upload updated one, now it seems working from my end!
    I'm also forwarding this fix to our plugin's developer for future release.

    Please check, and let me know if you face any issue regarding this issue!

    Regards,
    Ari

  • Danny
    • WPMU DEV Initiate

    Hey Ari, sorry for not responding.

    Thanks for getting back at me. Should I add your ZIP file to overwrite the current file in the plugin?

    I see my issue with the plugin was posted by one of your collegues and has been written a bit different.The thing is: when using the auto linking function for KEYWORD X with a link to POST X, on POST X there will be a link created too. But in that case, the posts links to itself. I don't want that to happen.

    Let me know if your file fixes this or if you need anything from me :slight_smile:
    (I actually did not know I could see your messages in my wpmudev dashboard, awesome!)

    Thanks!
    Danny

  • Ari
    • Recruit

    Hey Danny

    Yeah, this will fix that issue, It worked well in my test sites, and as well as on your test site too.

    We have a new version of this plugin, so before replace the file, at first update the plugin, then replace that plugins/wpmu-dev-seo/includes/tools/autolinks.php file, make sure you unzipped my attached file first.

    Regards,
    Ari

  • Nithin
    • Support Wizard

    Hi Danny,

    Hope you are doing good today. :slight_smile:

    Was it working fine before? Seems like the patch mentioned in here:
    https://premium.wpmudev.org/forums/topic/exclude-just-a-keyword-from-a-post-for-auto-links#post-1345866

    Was applied to SmartCrawl version 2.2.1, and I could notice the current SmartCrawl version in your system is 2.2.5, if you update the plugin, the patch applied would get overwritten as this hasn't been implemented in the plugin side yet.

    I could notice there are many changes in the version 2.2.5, so not sure whether the patch would help, I'm checking this with the developer, and will get back to you once we get further update asap. Have a nice day ahead. :slight_smile:

    Regards,
    Nithin

  • Panos
    • SLS

    HiDanny !

    As Nithin mentioned it hasn't been included yet. I have pinged the main dev about this so it's probably going to get in shortly. Until then I have done a minor modification to file shared above. I have attached it here and you can replace file:
    wpmu-dev-seo/includes/tools/autolinks.php
    with the one attached. Before replacing I would strongly recommend to rename file autolinks.php to something like autolinks.php.back to keep it as a backup.

    After replacing please do a few tests and let us know if you still see the keyword linked in their pages.

    Kind regards!

  • Nithin
    • Support Wizard

    Hi Danny,

    I did test the given patch and was working when tested in my system. Could I know on which page you are testing? I checked the following page:
    https://www.hostessbureau.com/klantgerichtheid/

    And I don't see any keyword called "klantgerichtheid" in there which has any links. Could you please point out the page link where this is being tested, and also please grant support staff access so that we could give a closer look.

    You can grant access from WPMU DEV > Support > Support Access > Grant Access, or check this manual: https://premium.wpmudev.org/docs/getting-started/getting-support/#chapter-5

    Please let us know once you enable access so that we could get this sorted. Have a nice day. :slight_smile:

    Kind Regards,
    Nithin

  • Danny
    • WPMU DEV Initiate

    Hey Nithin,

    Thanks for the response! When we look at: https://www.hostessbureau.com/klantgerichtheid/ you see "klantgericht" as link, right? I added that via the custom keywords. But it links to the post itself. The keyword name is different from the post name, but still this should not link to the post I think because it linkt to itself.

    Any ideas? :slight_smile:

    I cannot give acces on this website. But we can setup a test env. if needed.

    Cheers! Danny

  • Nithin
    • Support Wizard

    Hi Danny,

    Thanks for pointing that out. So, just to be clear you have the custom keyword called "klantgericht" added via custom keywords in SmartCrawl, and the custom keyword is linked to the following link:
    https://www.hostessbureau.com/klantgerichtheid/

    Right? If yes, it should have worked. That's it shouldn't have created the link "klantgericht" in your mentioned post.

    I tested again, by creating the same post as your given page link, and it didn't create any links for "klantgericht" text in my test server.

    Could you please share full screenshots of the custom keywords you have added? ie the SmartCrawl > Advanced Tools > Automatic Linking.

    Maybe it's something minor, if that doesn't help, then I'm afraid, we'll need to have access to your site. So, setting up a test env would also help.

    Please do let us know how you are looking forward to troubleshooting this further. Have a nice day ahead. :slight_smile:

    Regards,
    Nithin

  • Panos
    • SLS

    Hi Danny !

    Not sure if you managed to send in access info, I searched but didn't find any. I would need to have a look on your site to try figure out why this is happening on your site while we can't replicate this on our sites. Could you please send in admin and ftp access? You can send that privately through our contact form: https://premium.wpmudev.org/contact/#i-have-a-different-question

    Send in:Subject: "Attn: Panos Lyrakis"

    - Admin login:
    Admin username
    Admin password
    Login url

    - FTP credentials
    host
    username
    password
    (and port if required)

    Kind regards!

  • Danny
    • WPMU DEV Initiate

    Hi Nithin & Panos,

    Sorry for the late reaction. Was kinda busy. Yes I added that as custom keyword. See the attached files for the settings. If this does not help, I will setup a test env. so we can check it out together. Please let me know if that's the case.

    Kind Regards,

    Danny

  • Nithin
    • Support Wizard

    Hi Danny,

    Hope you are doing good today. :slight_smile:

    Sorry for the delay in getting back to you. Thanks for the screenshot, I'm afraid the screenshot doesn't help much in pointing out where the issue is located.

    Could you please send the Staging Website credentials as requested by Panos in the last reply, so this could be looked upon closely.
    https://premium.wpmudev.org/forums/topic/exclude-just-a-keyword-from-a-post-for-auto-links#post-1388894

    Regards,
    Nithin

  • Danny
    • WPMU DEV Initiate

    Hi!

    No problem. I thought so. I granted acces via the support tab in my plugin. I made an admin too for the test. I will send it now :slight_smile:.

    FTP does not work at the moment.. I can fix that later, but maybe you have enough info at this point?

    Thanks! Danny

  • Panos
    • SLS

    Hi Danny !

    I think this time we got it :slight_smile:

    Since we don't have ftp, could you try replacing the same file again
    includes/tools/autolinks.php

    with the one attached here? Then let us know if you still have this issue, in which case we would need ftp to check it closer :slight_smile:

    Kind regards!

  • Panos
    • SLS

    Hi Danny ,

    Not sure what you mean by get deleted. As in the front end you don't see the autolinks, or they get deleted from the settings?

    Since we don't have admin nor ftp access, could you share which plugin exactly you are using for this. If it doesn't use the the_content filter then Autolinks won't work in the front end if that is what you mean. But we need to check which plugin you are talking about to confirm that this is the case.

    Lind regards!

  • Panos
    • SLS

    Hi Danny !

    I don't see that info in the task. Sorry for that :slight_smile:

    However I think we would need ftp too, as that plugin seems premium. So you can either send in access info in the way mentioned here :
    https://premium.wpmudev.org/forums/topic/exclude-just-a-keyword-from-a-post-for-auto-links#post-1388894

    or you could send in the plugin zip so we could check if it does use that filter. In order to send in the plugins zip, you can upload it to Google drive or Dropbox or something else, and then send in the download link via our contact form. Make sure you also include the link back to this thread.

    Kind regards!

  • Nithin
    • Support Wizard

    Hi Danny,

    Thanks for sending in the FTP login credentials. I tested the login in my side, but I'm afraid it seems like either the username or password is incorrect. We are getting the following error when trying to connect via FTP:

    Response:	331 Password required for wpm@moonsdesign.space
    Command:	PASS ************
    Response:	530 Login incorrect.
    Error:	Critical error: Could not connect to server

    The above error means more towards the password is incorrect. Could you please check, and advise what's being missed. And if there is a change in the credentials, please re-send it again as done before.

    Regards,
    Nithin

  • Panos
    • SLS

    Hey Danny !

    Just realized I never replied here, so sorry for that!

    In case you still want a solution on this, you can try the mu-plugin from here:
    https://gist.github.com/wpmudev-sls/c45ae504b03d1e3ddaf04a38f3268b0b
    Download, unzip and upload file smartcrawl-amp-autolinks.php to your wp-content/mu-plugins folder. If that folder doesn't exist you can simply create it.

    Those are not being autolinked in AMP page cause AMP is not using the_content filter, which is the filter that SmartCrawl uses for autolinking. What the above snippet does is override the original AMP function and push the content through SmartCrawl's autolink replacement method. So you should see the link in the AMP pages too. Tested in a couple of my sites and worked fine, but I would strongly suggest to first try it out in a staging/testing site.

    Hope this helps and once again so sorry for not replying here sooner.

    Kind regards!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.