Achieving flat URL structure with woocommerce for SEO - wordpress

In an attempt to make a multilingual woocommerce website with a flat url structure we thing would be best for our store's seo, we tried every combinaison plugins/features/sustom code/htaccess we know and could not make it happen.
I know WP suggests NOT to remove the base slugs from urls but the main reason is to avoid conflict between slugs and we intend on writing ALL slugs manually.
So, in short lets says we have categoryA and categoryAB (child of A) and a productnamedsomething associated to categoryAB.The usual URL of woocommerce would be:
www.domain.com/product-category/categoryA/categoryAB/productnamedsomething
while we would simply want:
www.domain.com/productnamedsomething
up to there, the WP htaccess Control plugin was working wonderfull, but adding multilangual fonctionnality made it complicated.
We tried both polylang and WPML and could not achieve in any way our target URLs:
www.domain.com/productnamedsomething
www.domain.com/fr/unproduitquelconque
However, typing any of these URL in the address bar works and displays the product, without the category tree. But we cannot get menus, category menus and other links to point to a flat url structure.
So the main points here are:
Did anyone succeed in creating flat url structure in woocommerce and what was the wining combinaison of plugins/hack used?
If not, what would be the best way to go about it, manually removing categories using htacess or maybe overwriting theme functions to change widgets and menu links structure in php?
Is all this worth the hassle or is woocommerce's basic url structure
better than it feels for a shop's SEO?
Ask clarifications if needed, i'll be glad to discuss this.

Have you tried the WordPress rewrite API? https://codex.wordpress.org/Rewrite_API

Related

Remove product-category from url woocommerce

Problem 1:
I'm using WooCommerce on a WordPress and it adds product-category to the URLs.
domain.com/product-category/accessories/dishwashing
I need to remove 'product-category' from the URLs. Is there any way to modify the permalinks and remove them?
Problem 2:
Also, I want to change the permalink for the product.
Current url for product "Active AirClean (SF-AA 50) with TimeStrip" is: http://www.atimiele.co.uk/products/filters/active-airclean-sf-aa-50-with-timestrip/
I have a category structure for the product is:
accessories > floorcare > filters
So the url for the product shoud be
http://www.atimiele.co.uk/accessories/floorcare/filters/active-airclean-sf-aa-30-with-timestrip/
I believe that what you are trying to achieve is not possible with Woocommerce. My colleague tried to change this as well a couple of months ago without any success. If you do want to remove the slug from products+categories you can use a plugin. There are several plugins available, i don't know if I im allowed to post it here, but we used the Perfect seo url plugin for woocommerce. www.perfectseourl.com Although it costs a lot of money, it was a good choice.
Typically it will solve both of your questions. I would recommend not using too many 'subcategories' in your url structure. Try to use maximum 2 subcategories, for SEO reasons. Google will index only 3 levels.
Good luck!

Wordpress and Woocommerce: remove /product and /product-category from URL structure

Dear StackOverflow friends,
in a site with Wordpress and Woocommerce plugin,
I would like to change the URL of the pages of e-commerce in an SEO friendly structure and in particular I would like:
1) the individual product pages
www.mysite.com/product/productname
to become
www.mysite.com/productname
2) and the product category pages
www.mysite.com/product-category/categoryname
to become
www.mysite.com/categoryname
As regards the case 1 /product,
I have not found a plugin that could help me and I tried
A- to modify WordPress permalinks: inserting a slash followed by a dot /. products , URL takes on the structure that I want but the pages are no longer accessible and bring me an error of 'redirection loop'
B- to modify the .htaccess file, adding the following lines of code
// 301 Redirect Entire Directory
RedirectMatch http://testmywpshop.info/prodotto(.* 301) http://testmywpshop.info/$1
but probably I have not written/inserted that code correctly, because the site becomes inaccessible!
As regards the case 2 about /product-category,
I tried the plugin SEO Ultimate which has the function that suites my needs and I successfully converts the URL structure of product categories, but I'd prefer to get the same result without using it, because my friend wants to use SEO Yoast and there may be conflicts between these two plugins.
In conclusion, I wish URL wouldn't suffer broken links and redirections to be more acceptable to Google (maybe using the 301 redirection because it seems to be the only liked by robots) or even change the WordPress core code that determines the structure of the URL, but I have not been able to find it!
I read this Stack post and this Woocommerce documentation but I'd like to find an alternate way, if possible in your opinion.
I would also be happy to know your opinion about the usefulness of a modified URL structure, removing irrelevant words to the products sold in a e-commerce, to meet Google requirements (I found conflicting information about this subject).
Thanks for your advice and your help!
I would also be happy to know your opinion about the usefulness of a modified URL structure, removing irrelevant words to the products sold in a e-commerce, to meet Google requirements (I found conflicting information about this subject).
If you are looking to do this change to meet SEO Best Practices requirements, please note that this particular URL suggestion happened due to products that belong to multiple categories.
As such, urls that include categories can be detrimental.
www.example.com/product/drinks/milkshake and www.example.com/product/desserts/milkshake point to the same product. However, the problem here is not /product/ but /drinks/ and /milkshake/.
a WooCommerce site with a default product url like www.example.com/product/product-name is technically ok. I prefer to set my urls to www.example.com/shop/product-name as well as www.example.com/shop/category-main/category-sub/ as it is more descriptive. You can do this on WordPress Admin>Settings>Permalinks.
That said, if WooCommerce documentation says it's not a good idea, I usually don't pursue it. :)
Its possible to change the url structure, use a plugin for this.
old situation: domain.com/product/blue-trouser
new situation: domain.com/blue-trouser
or with categories
old: domain.com/product-category/pants/blue-trouser
new: domain.com/pants/blue-trouser
You will have to buy a plugin to get it this way.

WordPress Plugin Development Idea? Is this possible? Am I on the right track?

I'm very new to WP development. I host a website which needs a list of trails (hiking, biking, etc) and I'd like to write a WordPress plugin to do it.
Can someone please tell me if I'm taking the right approach, and if what I'm proposing is possible.
I'd like the site to end up with an auto-generated and filtered index at http://example.com/trail-guide, and the discrete trail info pages at http://example.com/trail-guide/trailname. This data would all be stored in a single database table holding info for each trail, with an admin page for adding, editing, and deleting entries from here.
Is a WP plugin the best way to go about doing this, or should I be looking at something else?
From the way you're describing, your best bet would be to Register A Custom Post Type. This can be done by adding to your existing theme's Functions.php file, or by creating a plugin.
If you don't plan on changing themes, my advice would be to just hardcode everything into your functions.php file. Otherwise, creating a plugin for this particular job would be the safest alternative.
Using this functionality in tandem with Custom Meta Boxes and Custom Taxonomies will allow you to keep everything organized within the Wordpress Framework with your own special data.
This means that these new posts can also be queried at any time through the standard Wordpress Loop or search box.
If you are uncomfortable with writing your own functions to extend your existing framework, you might want to look into some plugins like GD Custom Posts And Taxonomies Tools to manage your own.
Hope this helps.

Wordpress, two URLs for the same post

Is it possible to have two URL for a same post in wordpress.com?
One would be a short URL like
http://mydomain.com/28
and the other will be a SEO friendly one:
http://mydomain.com/28-this-is-the-post-about...
thanks
In wordpress, all posts are at the URL mywordpresshome.com/?p=xx where xx is the post ID number. Anything else involves mod_rewrite. WordPress will do one type of rewrite for you in the Admin section -- so you can pick either the short version or the long one above. In the Admin interface, it won't let you do both. But you could edit mod_rewrite yourself and effectively get both patterns -- short and long -- to work.
Here's info on mod_rewrite: http://www.workingwith.me.uk/articles/scripting/mod_rewrite
In the Settings->Permalinks part of the admin panel, you can set the look of your permalinks, but that doesn't mean the default dynamic links (yourblog.com/?p=5 or whatever) will stop working. You can use those links too and they will take you to the corresponding page. However, Wordpress will automatically substitute the dynamic link by its SEO-friendly alias.
I'm not sure whether it's possible to have two different aliases for the same post though.

How can I update my permalink structure in wordpress?

This is the old url of my blog (wp 2.2)
http://myblog.com/category-name/post-name
ex.
http://myblog.com/shoes/i-like-shoes
and Im trying to change it to
http://myblog.com/post-id/post-name.html
ex.
http://myblog.com/717/this-is-my-first-post.html
Im moving my content from wp2.2 to wp2.8 and i want to change all the categories for the current content from whatever it is now to "classic"
The problem of course is that some of my pages have a high page rank and I need to maintain this...
this is becoming a headache for me to figure out.
your help is appreciated!
Go to: http://myblog.com/wp-admin/options-permalink.php. Or, if you want to navigate manually :), go to your wordpress dashboard. In the Settings menu go to "Permalinks".
Also see http://codex.wordpress.org/Using_Permalinks for more detail, especially the fields for making custom permalinks.
Edit
To quote the above,
Using %category% with multiple categories on a post, or %tag%
When you assign multiple categories to a post, only one can show up in the permalink. This will be the lowest numbered category (see Manage Categories). The post will still be accessible through all the categories as normal.
The same thing applies to using the %tag% field in your permalink structure.
So... As long as "classic" is the lowest numbered category you use, that will work as the category name in the permalink.
Your change in structure however will break any external links pointing to your posts so your page rank is going to change as well. Unfortunately you need to choose which is more important: changing to permalinks without category names, or maintaining the pagerank of old posts.
If you just changed category names, you can do a redirect in htaccess for just the category name, IF the rest of your URL structure remains the same, i.e. date and post name.
If you changed more than just a cateory name, or don't want to mess around with htaccess, then use something like the Redirection plugin to easily handle redirects.

Resources