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

Don't think that solution works anymore. eg. I do not have that part on our script.js file :

$(document).ready(function() {

1


Boris Fernandez I just double checked my setup, and it's working currently with the above example code, even without this line in the script.js: 

$(document).ready(function()

One thing I can think of that might be causing this to not work as expected, is that you may need to check that your script.js file is valid code syntax. If it has a syntax error, it will break the file and not fire the contents correctly. I can see that GoGet Support up there for example, if I try to visit the URL they are trying to redirect to, I can see the script.js has a syntax error on line 5, which is probably why this is not working for them. You can see in the dev console, if the script.js throws an error when the page loads.

1


CJ Johnson  cannot make it work. Actually no error from the JS on the dev console. Not sure what I am doing wrong.

When you say you do not need the function, how do you input the code in the script.js ? 
I tested the error_page.hbs also to see if I could miss something but nothing off there too... 

Everything looks pretty straight forward though...

1


So we've been using this code for a long time, and today it suddenly stopped working. We haven't modified our template in any way recently, other than to add more articles to var oldIDS and var newIDs. Has anyone else had this experience?

2


How can I setup redirects from an article on a different brand? Also, following this guide isn’t working for me; it’s requiring a login when accessing the old article because it’s trying to access Zendesk admin for that article

1


Do archived articles change the analytics in Explore?

For instance, if I have a report that shows the total # of articles views and I remove one article that had 100 views, does the report show the total #of article views drop by 100? Or does it keep track of all article views, regardless of whether they are archived? How about deleted?

1


So sad there isn’t a good solution for this after all these years. It’s been requested so many times. Even HelpScout with so much less functionality has a better redirect system.

1


Hi,

I added the code as suggested, and it is redirecting well.

The only issue I'm facing is the "flickering". I see the "old" article content for some milliseconds, and then it redirects to the new article.

Any solution to resolve this?


Thanks 

1


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


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.