---
title: "nxt_field_value_raw() — Read the Stored Value"
url: https://nexterwp.com/docs/nxt-field-value-raw/
date: 2026-09-14
modified: 2026-11-12
lang: en
author: "Aditya Sharma"
description: "nxt_field_value_raw() returns what is actually in the database, with no formatting and no regard for conditional logic. It is the function to reach for when the formatted getter returns nothing..."
image: https://nexterwp.com/wp-content/uploads/2026/09/nxt-field-value-raw-1024x519.jpg
word_count: 293
---

# nxt_field_value_raw() — Read the Stored Value

## Key Takeaways

- nxt_field_value_raw() returns the stored database value with no formatting and no conditional logic, so it serves as a debugging tool when nxt_field_value() returns nothing.
- Nexter Extension must be active, the field’s Field Name must be known, and the user must be editing a template or a plugin before calling nxt_field_value_raw().
- nxt_field_values_raw() returns every raw value on the object, while serialized values come back as PHP arrays and conditional logic is ignored.

`nxt_field_value_raw()` returns what is actually in the database, with no formatting and no regard for conditional logic. It is the function to reach for when the formatted getter returns nothing and you need to know why.

## What It Does

Where `nxt_field_value()` applies the field’s return format and honours its conditional logic, the raw version does neither. It is a debugging tool first and a data tool second.

## Before You Start

- Nexter Extension is active.- You know the field’s **Field Name**.- You are editing a template or a plugin.

## Use the Raw Value

- Call `nxt_field_value_raw()` with the field name and an optional object.

- Expect the stored shape, not the formatted one — an image field gives you whatever was saved, not a URL.

![The Conditional Logic tab, which this function respects](https://nexterwp.com/wp-content/uploads/2026/09/nxt-fields-s-tab-conditional-logic.webp)

- Use it to confirm a value exists when the formatted getter returns null.

- Prefer `nxt_field_value()` for normal rendering, so return formats keep working.

## Display the Value

Comparing the two is usually the fastest diagnosis:

`<?php
var_dump( nxt_field_value( 'price' ) ); // formatted, respects conditions
var_dump( nxt_field_value_raw( 'price' ) ); // exactly what is stored

// every raw value on the object
$all = nxt_field_values_raw();`

## Limitations

- No return format is applied, so you handle the stored shape yourself.- Conditional logic is ignored, so you can read a value the editor cannot currently see. Be deliberate about whether that is what you want to render.- Serialized values come back as PHP arrays, not as the tidied structures the formatted getter produces.

## Troubleshooting

### Raw returns a value and the normal getter returns null

The field’s conditional logic is not met. That is the formatted getter working as designed.

### Both return nothing

Then nothing is stored. Check the field name and that the post was saved.

## Related Docs

- [Template functions reference](https://nexterwp.com/docs/nexter-fields-template-functions/)- [Display a custom field value](https://nexterwp.com/docs/display-custom-field-value-wordpress/)- [Conditional logic for custom fields](https://nexterwp.com/docs/conditional-logic-custom-fields-wordpress/)

## Frequently Asked Questions

**Q: Why does the normal getter return null when the raw value still exists?**
A: The formatted getter can return null when the field’s conditional logic is not met, even though the stored value is still in the database. `nxt_field_value_raw()` ignores conditional logic and reads the saved data directly, so it is the faster way to confirm whether the value is actually there. That makes it a debugging tool first, not the default for rendering.

**Q: When should I use nxt_field_value_raw() instead of nxt_field_value()?**
A: Use `nxt_field_value_raw()` when you need the stored value exactly as it was saved, especially if `nxt_field_value()` comes back empty. The raw function skips return formatting and conditional logic, so it is useful for debugging or inspecting data shape. For normal output, `nxt_field_value()` is still the better choice because it preserves return formats.

**Q: How do I display a custom field’s stored value in a template?**
A: `nxt_field_value_raw()` takes the field name and an optional object, then returns the stored value without formatting. The page shows a simple comparison with `var_dump( nxt_field_value( 'price' ) );` and `var_dump( nxt_field_value_raw( 'price' ) );` so you can see the difference between formatted output and raw database data. For all raw values on an object, `nxt_field_values_raw()` is available too.

**Q: What are the limitations of using raw field values in WordPress?**
A: Raw values come back exactly as stored, so you handle their shape yourself. That matters because no return format is applied, conditional logic is ignored, and serialized values come back as PHP arrays instead of tidied structures. In practice, that means raw output is great for inspection, but risky if you expect editor-friendly formatting.

**Q: What does it mean if nxt_field_value_raw() returns something but nxt_field_value() returns nothing?**
A: That usually means the field’s conditional logic is not met. The raw getter reads what is in the database, while the normal getter respects conditional logic and hides values that should not be shown in that context. In other words, the data exists, but the formatted path is behaving correctly for display rules.

**Q: What should I check if both raw and formatted field getters return nothing?**
A: If both functions return nothing, then nothing is stored for that field. The practical checks are simple: confirm the field name is correct and make sure the post was saved. Nexter Extension must also be active for these template functions to work at all, so that is part of the baseline setup.
