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

wp-custom-fields

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.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Damien Oh Avatar

Read next

Suzanne Simard sealed paper birch and Douglas fir seedlings inside plastic bags, fed them carbon-14 and carbon-13 dioxide, and nine days later found carbon had crossed between species through fungal threads in the British Columbia soil beneath her boots
A species of jellyfish called Turritopsis dohrnii can revert its adult cells back to a juvenile polyp stage when injured or starving, effectively restarting its life cycle, and biologists have so far failed to identify any natural limit to how many times it can do this.
A Japanese man named Jiroemon Kimura, who lived to 116, was born in 1897 when Queen Victoria still ruled and died in 2013, meaning a single human life personally overlapped with the invention of the airplane, the atomic bomb, the internet, and Instagram
The Hollywood sign originally read HOLLYWOODLAND when it was built in 1923 as a real estate advertisement for a housing development, and it was only meant to stand for 18 months, but nobody ever got around to taking it down and the city eventually adopted it as a landmark
Almost all of the world’s internet traffic does not travel by satellite but through fibre-optic cables lying on the ocean floor, a hidden web of wires crossing the deepest parts of the sea to connect the continents.
People who flip their phone face down on every table aren’t being secretive. They figured out that staying interruptible meant handing their time to whoever rang first
Twitch vs. Facebook Gaming vs. YouTube Gaming: What’s the Best Live Game Streaming Platform?
Chrome Extensions Ownership Transfer is a Direct Threat to You: How to Stay Safe