Renaming fields and attributes in QGIS is a common task that can help make your data more understandable and easier to work with. This step-by-step tutorial will guide you through three methods of renaming fields in QGIS: using aliases for temporary changes, editing field names directly for permanent changes, and using the Refactor Fields tool.
Working with QGIS? You should be listening to our podcast!
Prerequisites
- Ensure you have QGIS installed on your computer.
- Have a vector layer loaded in QGIS that you want to edit.
Method 1: Using Aliases for Temporary Field Name Changes
Step 1: Open Layer Properties
- Right-click on the layer you want to modify in the Layers panel.
- Select “Properties” from the context menu to open the Layer Properties dialog.
Step 2: Navigate to the Fields Tab
- In the Layer Properties dialog, click on the “Fields” tab on the left side.
Step 3: Set Field Aliases
- In the Fields tab, you will see an “Alias” column next to each field name.
- Click in the Alias cell for the field you wish to rename and type the display name you want to use. For example, enter
State Nameas the alias forname_2. - Repeat this process for any other fields you want to rename.
Step 4: Apply Changes
- Click “OK” at the bottom of the Layer Properties dialog to apply your changes.
- When you open the attribute table, you will see the column names displayed as the aliases you have set. Remember, these changes are temporary and only affect how field names are displayed in QGIS, not the underlying data.
Method 2: Permanently Renaming Field Names
Step 1: Open Layer Properties
- Right-click on the layer in the Layers panel and select “Properties.”
Step 2: Go to the Fields Tab
- In the Layer Properties dialog, select the “Fields” tab on the left side.
Step 3: Enable Editing
- Click on the “Toggle Editing Mode” button (a pencil icon) to allow changes to the field names.
Step 4: Rename Fields
- Find the field you want to rename and double-click on its name in the list. This action allows you to edit the field name directly.
- Type the new field name and press Enter. For example, rename
name_2toState Name. - Repeat for any other fields you wish to rename.
Step 5: Save Changes
- After renaming the fields, click the “Toggle Editing Mode” button again to save your changes. QGIS will ask if you want to save the changes made to the layer.
- Click “Save” to confirm and permanently apply the new field names to the data source.
Step 6: Verify Changes
- Open the attribute table to verify that the field names have been updated as expected.
Method 3: Rename Fields Using the Refactor Fields Tool
The Refactor Fields tool is the most flexible approach for renaming fields in QGIS. It is particularly useful when working with formats that do not support in-place editing, such as CSV files, or when you want to rename multiple fields at once and output a new layer.
Step 1: Open the Refactor Fields Tool
- Go to Processing > Toolbox to open the Processing Toolbox panel.
- Search for “Refactor fields” and double-click to open the tool.
Step 2: Configure the Fields
- Select your input layer from the dropdown.
- In the fields table, edit the “Name” column for any field you want to rename. You can rename as many fields as you like in a single operation.
- You can also change field types and lengths in the same step.
Step 3: Run the Tool
- Specify an output file path or leave it as a temporary layer, then click Run.
- The output is a new layer with the renamed fields. The original layer is not modified.
Conclusion
By following these steps, you can easily rename fields in QGIS either temporarily using aliases, permanently by editing field names directly in the Fields tab, or non-destructively using the Refactor Fields tool. This flexibility allows you to tailor how your data is presented and organised, making it more accessible and easier to understand for both you and others who may use your data.
Frequently asked questions
Here are some frequently asked questions about renaming fields and attributes in QGIS.
What is the difference between a field name and an alias in QGIS?
- A field name is the actual name of the column in the data source, while an alias is a display name set within QGIS that makes the field name more readable without altering the original data.
Can I permanently change a field name in QGIS without affecting the source data?
- No. Permanently changing a field name in QGIS does alter the source data. If you need to change a field name without affecting the source, use an alias instead, or use the Refactor Fields tool to create a new output layer with the renamed fields.
How can I rename multiple fields at once in QGIS?
- The Refactor Fields tool (Processing > Toolbox > Refactor fields) allows you to rename multiple fields in a single operation. The GUI method in Layer Properties requires renaming each field individually. For advanced users, Python scripting via the QGIS Python console can also automate batch renaming.
Will renaming fields in QGIS affect my data analysis or map outputs?
- Renaming fields using aliases will not affect data analysis or map outputs. However, permanently changing field names alters the dataset and could break analyses or outputs if field names are referenced in expressions, queries, or scripts.
Is it possible to revert to the original field names after changing them?
- If you have used aliases, simply clearing the alias will revert to displaying the original field name. If you have permanently changed field names, you will need to manually rename them back, assuming you have documented the original names.
Can I change field names in QGIS for all types of data sources?
- The ability to permanently rename field names depends on the data format and its permissions. Some formats are read-only or have provider-level restrictions that prevent field renaming. GeoPackage and PostGIS layers generally support renaming, while formats such as CSV are read-only for field editing. In those cases, the Refactor Fields tool is the recommended approach.
What happens to the attribute data when I rename a field in QGIS?
- Renaming a field does not affect the data stored within that field; it only changes the field’s label. All attribute values remain intact, whether you are using an alias or permanently renaming the field.
How do I rename fields in a shapefile using QGIS?
- The process for renaming fields in a shapefile follows the same steps as other vector layers. Note that the shapefile format (DBF) imposes a maximum field name length of 10 characters, so longer names will be truncated. To avoid this limitation, consider exporting the layer to GeoPackage format, which supports longer field names, before renaming.
Can renaming fields in QGIS help with data management and organisation?
- Yes. Renaming fields can significantly improve data management and organisation, making datasets easier to understand and work with, especially when inheriting data that was not originally created by you.






