What if you face any 404 error on your online store while using Dokan? Here is the probable fixes for you if you face any 404 error for your online store.
So basically, 404 error occurs due to the things below:-
- Missing pages
- Wrong/no shortcode
- Pages are not selected in the settings
- Wrong permalink structure
- Duplicate Pages
How to check 404 Error
Missing Pages: Dokan installs 3 different pages in your WordPress system when you activate the plugin for the first time
- Dashboard– This is the most important page and you must have this page installed with the shortcode [dokan-dashboard]
- Store List– This is an optional page. If you want to show a list of all the stores in your site, then you can create a page with the shortcode [dokan-stores]
- My Orders– This too is an optional page. If you want the customers to view all their orders in a separate page, then you can create a page with the shortcode [dokan-my-orders]
Wrong or No Shortcode: The page items are fetched with some specific shortcodes. If you mistype the shortcode or accidentally remove the shortcode from the page, then that might cause a 404 error.
Select Pages on Settings: ‘Dokan page settings‘ is located on WP-admin → Dokan → Settings → Page Settings. No matter what the page name is or its URL, you must select the page from here. And do not forget to place the correct shortcodes on those pages.
Dokan has a static templating system which requires the permalink to be in a required format. You have to set the permalinks to Post name and Product for Dokan to work perfectly. It is also a search engine friendly URL structure and human readable as well.
Select Post Name under Common Settings.
Select Custom Base/product/ under Product Permalinks.
How to set the permalinks for Dokan
- Login to WordPress admin.
- Navigate to Settings → Permalinks
- Select “Post Name” for common posts
- Select “Custom Base” for product permalinks and write
/product
on the box. - Hit Save Changes and you are done.
In case of new add-ons
If you have installed a new add-on for Dokan and getting a 404 error on the page for that add-on. Or can not find the newly installed plugins menu, just navigate to Settings → Permalinks and hit the “Save Changes” button. It will be solved.
This will flush the permalink structure and rewrite rule.