I have a hotel booking website and I want to change my URL slugs to be more SEO friendly.
Currently, I have www.domain.com/cities , and then when you go in each city, you’ll land on a page like “/city-list/barcelona”, where the page is “city-list” and “barcelona” is a dynamically inserted from my table of cities, with RG hotels from Barcelona. I want to change it /hotels-barcelona, hotels-bali and so on. How would I do that?
Don’t use current page type of data since that makes it impossible. You need to use text in your data to send to form URL path lists.
I’ve done this a lot and have posts on the forum about it so searching with my handle and SEO should return some. Basic idea is that you need a page called cities (not the index since that will always end up with domain.com/index the moment you try to add additional path list items) so that you can structure the path list to be what you want, such as domain.com/cities/en/spain/barcelona/old-town so that you can structure them to follow the types of filters that a good hotel booking site would have, such as language, country, city, district and potentially more like apartment…this way you can optimize your SEO to have page titles, descriptions etc. that can read something like ‘Find the most compatible apartments in the Old Town district of Barcelona Spain’.
So /cities is not the index; it’s a page I created. And then from that page if you hit a picture or link you will go to a page called city-list/barcelona. City-list is a page again and the content of that page is a fitered result based on the city selection from the previous page. Barcelona is a city from the data base. So it dynamically places the city after the city list depending of what city you’ve chosen in the previous step.
Should I transform my pages in SPAs and just use slugs+text? Is this what you’re telling me?
That is a post talking about a plugin of mine I made to make the whole process easier for me after years of needing to work on such tasks for clients and the complexity of URL path list items when not always having a set, known number of path list items (ie: sometimes, city is missing but state available, or no location and only category, or sometimes city, state and category). There are various other posts where I talk about the use of URL path list items and arbitrary text in data to send.
No. What I am saying if you want the best SEO for a booking site that uses cities, states, countries, category types etc. to use URL path list items, do not use a page content type so that you can use arbitrary text in data to send for go to page action to form the URL path list based on selected values, like the city, country and category type.
I wouldn’t do that myself for trying to optimize SEO for a booking site, but if you are following that approach, it should work fine if all you expect to ever do is SEO for the city.
As I mentioned, you need a page with the name of the first path item in path list, in this case hotels would be page name, then for optimized SEO use a / to separate in the URL path list the city name so you have hotels/barcelona…but if you are building a booking site with more than just hotels, like maybe apartments, or maybe activities, you can use a page name like book so you can have URLs like book/apartments/barcelona or book/activities/surfing/bali and any number of combination with the types key words use in searches for such things based on location and categories.
thanks, but then how does the next page know what to load if it doesn’t receive anything!? My next page is a city page with all the hotels in that city.
And 2. When I close the window after I created my dynamic aribitrary text, I get the arbitrary text in red like an error
Because the page likely has a content type, which again, you can not do if sending text.
It may ultimately be easier for you to not strive for optimal SEO abilities and just get something decent and use an approach you are comfortable with if URL paths are complicating things for you.
When you do the Get Data from URL use Path List, not path. Path is entire thing, from page name to end. Path list is also, but separated into items so bubble exposes path list item # operator to extract a specific item in path.
So page name is normally path list item #1, and each / will represent another path list item.
And by the way, how can I remove that city-list page from the URL? that is basically the page which show all hotels in istanbul or the city read from the URL.I would like a clean URl without that like https://domain.com/hotels/turkey/istanbul?debug_mode=true
Change name of page from city-list to hotels in your app
In regards to your search I don’t know what’s wrong, could be many things. I suggest first start by testing you’re extracting correct url path list item and see what the value is
@boston85719 has the right idea here, but I have to mention, I recently did something very similar and the sudsy plugin helps a lot with urls/paths/params, check it out.