GeoDirectory create new settings in the WordPress Permalinks options to adjust the permalinks patterns for GeoDirectory pages.
If you have the Location Manager installed you have additional options for controlling the behavior of archive links on the Detail and Archive page templates.
For V2 this is the URL structure for archive (taxonomy) pages based on the Archive template:
URL Pattern Variables
/CPT_SLUG/ is set in the CPT Settings, for example: Places – Settings – slug
/CAT_BASE_SLUG/ is set in WordPress – Settings – Permalinks – GeoDirectory Taxonomies – Category Base
/LOCATION_SLUG/ is set as the slug of your site’s GeoDirectory Location page
Archive Page URL Patterns
Custom Post Type Archive URL Pattern
/CPT_SLUG/%country%/%region%/%city%/%neighbourhood%/ (with Location Manager neighborhoods option)
Custom Post Type Category Archive URL Pattern
/CPT_SLUG/CAT_BASE_SLUG/%category%/ – without any location parameter
/CPT_SLUG/CAT_BASE_SLUG/%category%/%country%/%region%/%city%/%neighbourhood%/ (with Location Manager neighborhoods option)
Location Page URL Pattern
/LOCATION_SLUG/ (“Everywhere”) – or
/LOCATION_SLUG/%country%/%region%/%city%/%neighbourhood%/ (with Location Manager neighborhoods option)
Remove Country or Region from URLs displayed in GeoDirectory elements when using the default location
The only time this structure will change is if you are only using the default country and default region.
Tick the options shown below in the Locations tab (Location Manager) to remove respective slugs from the Location and Archive URLs displayed on the frontend. Of note, the pages will still exist, but your links will not include the reference to the country or region.
GeoDirectory – Settings – Locations (tab)
CAT_BASE_SLUG is required and should be set carefully to make sure that there are no conflicts with the slugs for other post types, posts, locations, or categories.
V2 Archive URLs use a different structure than V1 in order to make them more compatible with WordPress permalinks. When a site converts to V2, GD creates redirects to take users to the new URLs.
Archive and Archive Item Design
Archive pages using the above structure are produced automatically by GeoDirectory. You can adjust the layout and elements on the page by adjusting the Archive or Archive item templates.
Get support on our forum, find out more here: https://wpgeodirectory.com/docs-v2/geodirectory/support/
If you are getting “404 – Page Not Found” errors, try re-saving your permalinks.
This is a two-step process. First you have to change the GeoDirectory permalinks to a different setting,, save, then set them back to your preferred setting and save again.
- Open the settings at: WordPress – Settings – Permalinks
- Choose a different setting for your GeoDirectory permalinks, then save. Do not use ‘Plain’ if that is offered as a setting.
- On reload, switch back to the setting you had before, and save again.
- Check the page to see if the issue persists.
Use pattern /cpt/city/category/post-name/ for listing URLs
This is possible but this pattern will only be applied to the Detail listing page of your CPTs.
Archives will still have the structure documented above.