Removing "article" from URL

This support request was posted in Flatbase by kinokeo

Request ID #4677 In Progress
  • I’m trying remove the “article” portion of the URLs in the knowledgebase. Currently an example URL looks like
    mydomain.com/article/billing/billing-information

    Another post on this forum (http://nicethemes.com/forums/topic/clean-url-permalinks/) suggests either installing https://wordpress.org/plugins/custom-post-type-permalinks/ or playing with the code. The plugin doesn’t have the option to remove the “article” portion as far as I can tell, only effect what comes after it.

    I’ve been looking around but can’t see where to alter the code in WP to change the URL structure for articles – only the category base, which “article” apparently isn’t. Could someone give me some pointers on where to start?

    Also, I tried https://wordpress.org/plugins/fv-top-level-cats/ but this didn’t work as it doesn’t see “article” as a top level category.

    Thanks

    Juanfra Aldasoro

    Hi Tim,

    Thanks for writing and hoping that you are well.

    Unfortunately there’s no way to remove the /articles/ part of the URL. That part of the URL indicates to WordPress that it should retrieve that certain article. That’s the way that WordPress handles the requests, query the information in the database and return an html page.

    With the plugins I’ve suggested you can change the /articles/ portion into something else. That can be done, but unfortunately not the removal.

    Best,
    Juan.

    Hi Juan – thanks for your reply.

    I’ve tried changing the “article” into something else using the two plugins I mentioned, but neither seems to do this. Could you give me some guidance on how I would go about this?

    Thanks

    Juanfra Aldasoro

    Hi Tim,

    Unfortunately those plugins modify WordPress built-in features and are not from our authorship, so we can’t provide support on that. I’m pretty sure it should be related to flushing the permalinks. Be sure that your .htaccess file can be modified by those plugins.

    And I’m sure, the plugin authors will be more on topic to give you some guidance on their products.

    Best,
    Juan.

    Hi Juan

    My client is quite particular about removing the “article” part of the URL. None of those plugins were able to remove it. The only option I think I have left is an htaccess rewrite. I’ve tried a few things that I thought should work, but for some reason no effect.

    For example:
    `
    # END WordPress
    # RewriteRule ^article/(.+)/$ /$1 [R=301,L]
    `
    with or without this before it:
    `
    Options +FollowSymLinks
    RewriteEngine on
    `
    I’ve tested that the htaccess file is being read, but it seems maybe the rewrite isn’t. Is there any way this could be related to the theme? I haven’t had much luck solving this via the WP forums so far. I realise this isn’t exactly a theme issue, but are you able to offer any guidance on an .htaccess solution to rewrite the URL instead. Htaccess is definitely one of my weaker areas!

    Many thanks

    Juanfra Aldasoro

    Hello,

    I understand, but that’s related with WordPress and not the theme/

    There is, literally, no chance of removing that part of the url, you’ll need to leave at least, a letter. For example, yoursite.com/a/the-article. That string is telling WordPress which query should be done.

    Best,
    Juan.

    Hi Juan

    Thanks for your advice. I have actually found a plugin that does it: https://wordpress.org/plugins/custom-permalinks/ but you have to manually input the URL you want for each article. I was hoping for a more holistic solution.

    I think it should be possible to simply rewrite what the user sees in the address bar, even though the actual page URL has the “article” in it (which is possibly what the above plugin is doing).

    But I understand this isn’t part of the theme and I’ll pursue this in some of the more generic web forums.

    Thanks again for your help.

    Hi there,

    No problem. I’d recommend you to visit the forums over http://wordpress.org

    Best,
    Juan.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.

Login to your Account

Welcome back! Please log in to your account by filling the fields below:

Forgot?

Not a member? Create a free account.

Create a Free Account

You're 27 seconds away from some awesome WordPress free stuff, benefits and more. Create a free account and have access to our free products, benefits and more!

Already have an account? Log in
Secure Server