Learn how to quickly update your old search form to a new one using a plugin for WordPress.
If you have previously placed an old search form widget via shortcode using the Travelpayouts WordPress plugin and now want to quickly upgrade your search form to a new one, follow the instructions in this article.
Who can use this instruction: anyone who already has the old Aviasales or Hotellook search form installed via the Travelpayouts WordPress plugin.
To upgrade, you need to get the widget code for the new search form. You can do this in two ways: in your Travelpayouts personal account or directly inside the Travelpayouts WordPress plugin. Let’s take a look at how to do this in detail.
Updating using a code from your personal cabinet
- Login to your Travelpayouts account.
- Select the search form widget you need:
You can simply follow the link above or find the widget yourself in your Travelpayouts account. To do this, go to the Programs section, select the Aviasales or Hotellook program, and go to the Tools -> Widgets tab. In the list, find the Search form widget and click Set up.
- Copy the code of the widget.
- Open your WordPress admin dashboard and go to the Travelpayouts plugin section.
- In Search forms choose the record with the previously created old search form and click Edit.
- Paste the new search form code into the Generated Widget Code field and click Save.
- Done! All the old search forms hosted on your site will be updated to the new ones!
Updating via Travelpayouts WordPress plugin
- Go to your WordPress admin dashboard and under Pages, open the article editor or create a new one.
- Click on the Travelpayouts icon in the article editor menu.
Note: the icon is only available if you are using the classic block editor and the Gutenberg block editor.
- A block will appear in the body of the article. Click the Widgets button on it.
- Select the desired program (Aviasales or Hotellook) and then select the Aviasales or Hotellook form widget (the one at the bottom of the page):
- Click Settings on the widget to customize the search form by specifying the desired parameters to display the results. For example, you can specify departure and arrival city, departure and arrival dates, and number of passengers.
- Click Embed widget:
- Copy the created code from the article editor view:
- Go to the Travelpayouts plugin section.
- In Search forms choose the record with the previously created old search form and click Edit.
- Paste the new search form code into the Generated Widget Code.
- Remove [tp_widget] at the beginning and end of the code and click Save.
- Done! All the old search forms on your site will be updated to the new ones!