100tiao1: How-to instructions you can trust. Internet How to Show More Than 30 Custom Fields In WordPress [Quick Fix]

How to Show More Than 30 Custom Fields In WordPress [Quick Fix]

Whenever you compose (or edit) a post in WordPress, you will notice that there is a section called “Custom Field” where you can add custom variable (also known as meta-data) and value to your post. This is a very useful feature that allows you to customize each post with a custom value.

However, there exists a small problem that can hinder your usage of the custom field effectively. By default, WordPress only display a total of 30 custom fields in the dropdown list. This means that if you have more than 30 custom fields, the rest will not be shown in the list. They are still around though, but are not displayed for your selection.

I have recently activated a plugin and it added over 20 custom fields to the database, causing my own custom fields to be pushed out of the list. Here is how you can get your WordPress to display more than 30 custom fields.

1. Login to your WordPress dashboard with your admin account. Go to the “Appearance -> Editor” section.

2. On the right column where it shows the link to your various theme file, click the “Functions.php” link. This will load the “functions.php” content onto the text editor.

3. Scroll all the way down to the end. Just before the ?> tag at the very bottom, paste the following code:

function increase_postmeta_form_limit() {
	return 120;
}
add_filter('postmeta_form_limit', 'increase_postmeta_form_limit');

4. Press the “Update File” button.

Now go back to the Post editor and you will find the custom field selection list has increased from 30 to 120.

Done.

Note: if you are not able to update the file, it is beacuse you have not set the correct file permission to allow the system to write to it. In this case, you will have to download the “functions.php” file (via FTP) to your computer, save the file and re-upload back to the server.


Damien Oh

Damien Oh started writing tech articles since 2007 and has over 10 years of experience in the tech industry. He is proficient in Windows, Linux, Mac, Android and iOS, and worked as a part time WordPress Developer. He is currently the owner and Editor-in-Chief of Make Tech Easier.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Sign up for all newsletters.
By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time. Subscribe

Related Post