Recent searches


No recent searches

Can I redirect traffic from deleted help center articles?



image avatar

Jérémy

Zendesk Customer Care

Edited Nov 18, 2024


7

57

57 comments

Hi 

This redirecting code was working just fine, but I just found out it is not working now. When I access the old page, 404 page shows up.

I added the new and old ID in the script today, but I didn't change other parts of the code. 

  

0


image avatar

Greg Katechis

Zendesk Developer Advocacy

Hi Sawako! I took a look at your help center and it looks like you aren't following the instructions in the article correctly. It states that you need to add the script before the JQuery function runs, however you have it after that line. Please move that above and let us know if that resolves it for you.

0


Greg Katechis

Thank you for checking my code!

The following code is already written right above the redirecting code. Could you see the attachment?

  $(document).on("click", function() {
    $(".share-label").attr("aria-selected", "false");
  });

0


image avatar

Greg Katechis

Zendesk Developer Advocacy

Right, which is the issue...it's supposed to be above that and you have it below it.

0


Greg Katechis

I moved the following code, but it still doesn't work.

$(document).on("click", function() {
    $(".share-label").attr("aria-selected", "false");
  });

 

0


image avatar

Greg Katechis

Zendesk Developer Advocacy

And are you seeing any errors in the console that may help this situation?

0


Greg Katechis

no errors

0


Greg Katechis

Now it's working! thank you for helping me.

The problem was in other part of code. 

0


Honestly, I am in awe that the Zendesk product team considered this release ready.

It's unreasonable to expect your users—help docs and technical writers—to have to know JavaScript to configure basic redirects for duplicate or obsolete pages. This is functionality that should have had a full WYSIWYG decade ago in the platform. 

0


Hey Greg Katechis,

I look in our script.js file and it doesn't have the below line:

$(document).ready(function() {

If that's missing, can we simply add it? Do you know which line would be the best place to add it? Thank you.

0


image avatar

Greg Katechis

Zendesk Developer Advocacy

Hi Josh! I took a look at your help center and it is pretty heavily customized, so I'm assuming that's the reason that you're not seeing it. I would recommend talking to the devs that built that to see how they developed it to see if they can steer you in the right direction. As it stands, it really wouldn't be possible for me to tell you how to proceed in this situation, so they will be your best bet!

1


Hi Greg Katechis,

Please take a look at my code as well. I have copy-pasted part of it here. Reading thru the comments, I have added it within the ready function. I don't see any jquery code above my code. Can you please help me understand why the code isn't working. As soon as I click on the old article link, I keep hitting this zendesk auth page.

(function () {

"use strict";

ready(function () {

//Redirect old/deleted article links to new ones

varoldIds= ["4403387371533", "4403388286093"];

varnewIds= ["17697696633997", "4403392789005"];

for (vari=0; i<oldIds.length; i++) {

if (window.location.href.indexOf(oldIds[i]) >-1) {

window.location.href=

"https://support.neofinancial.com/hc/en-ca/articles/"+newIds[i];

}

}

0


Hello—I've had success with this workaround on the article level, but is there any way to make it work for anchor links? As our Help Center grows and evolves, the internal structure of the articles will often change, and headers (which have those anchors) will be deleted or moved to other articles, etc. But there are still links out there in the wild that point to these anchored links, and I'd like to be able to ensure they are redirected to where they need to be.

(Also, why is this so challenging in Guide? Every other CMS I've worked with supports redirects a lot more efficiently than this. Are there plans to enhance this?)

0


Does this process work for archived articles as well, or only for deleted articles?

0


Hi Zendesk team - does this option work with archived articles at all? or do I have to delete an article before I can go through the process of redirecting the URL? 

I'd prefer archiving, just in case I want to re-work content later. 

Please advise? 

Cheers

E.A. Brown

0


Hi Elizabeth Brown and Philip Addison

While you are waiting for Zendesk team to respond, I can share my experience here. For me, the code only worked when I archived the old articles. "Unpublishing" the old article led to a redirect to an authentication page and not to the new article.

I haven't tried deleting an article and redirecting it yet, so cannot comment on this part.

Best,

Ani

0


I am trying to redirect all broken links to my home page, would method 3 work for this? I tired and just entered in the homepage address instead of a specific article but its not working. 

0


Julio H Regarding 301 redirect Early Access Program:

I applied through the google form a few days ago and it said someone would contact me about getting on the EAP but I haven't received any email acknowlegement. Do you know anything about the EAP?

0


image avatar

Madison Hoffman

Zendesk Digital Resources Team

Wilson Ho, unfortunately I don't think anything in this tutorial would cover that use case. In method 3, you specify unique URLs to redirect. But looking at the bigger picture, I would question the UX of automatically redirecting a broken link to point to your home page. As an end user that could be a confusing experience. Would it maybe be better to customize the error state template to make it easy to get back to the home page instead? Could you share a little more about your use case?

David Morton, I'll ask the Guide team to look into this!

0


Hello,

I'm using the Copenhagen theme (2.19.4) and nowhere in the script.js file do I see anything similar to:

$(document).ready(function() { 

Do I just add the redirect to the file? Does it need to be at the top of the file or is it ok to append to the bottom?

Thanks

0


We are considering using this edit in our theme code. I have a related question...does anyone have a tool we can use in Zendesk Help Center to find broken links? 

0


Also, does this code work for archived articles as well as deleted articles?

0


image avatar

Gab

Zendesk Customer Care

Hi Stacie, 
 
That code can be found on line 5 of the Copenhagen theme. 
 

 
 
Hi Sally, 
 
I'm afraid there's is no way to check for broken links.
 
You can also check on this Community post here where there's been a few people asking about it as well: https://support.zendesk.com/hc/en-us/community/posts/115007417707-Managing-Links 
 
Furthermore, the examples provided in this article are for deleted articles. 

0


Thank you, Gab. So...the examples are for deleted articles. We generally do not delete articles as our practice. Is there a similar way to redirect archived articles as well?

1


image avatar

Gab

Zendesk Customer Care

Hi Sally, 
 
For the articles that are in draft or archived, they'll still be visible for you. However, the end-users won't be able to access them. If an end-user opens an article URL that has been archived, they'll see the "oops" error page on your Help Centre. This page is built on the error_page.hbs template that you'll find on the live theme in Guide. If a user opens an article URL that has been unpublished, they'll be asked to authenticate (if they're not logged in) and then get the "oops" page. In this case, there's no option to redirect them to a different URL as they won't be able to see this article. You might want to publish these articles and then add a custom code to the template to redirect the users to another article. 
 
Hope this helps! 

0


Hi

Can anyone advise how we could redirect a URL in Zendesk Guide to a page on an external site? (We have certain pages that now live elsewhere.)

We are looking to implement a 301 Redirect (not a JS-based flow).

Thanks!

0


I just discovered that this only seems to work for logged in users. Is it supposed to work when login is not required for the help site?

0


Please sign in to leave a comment.