Title: problem with search by code in admin
Last modified: January 25, 2024

---

# problem with search by code in admin

 *  [sacconi](https://wordpress.org/support/users/sacconi/)
 * (@sacconi)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/problem-with-search-by-code-in-admin/)
 * My post table: [https://ibb.co/ftvX33W](https://ibb.co/ftvX33W) .Pls note that
   the name “appartamenti” doesnt mean I have a specific post-type, I just changed
   the label. When I launch a search by code it works (I have a specific custom 
   code to do it), but when I want to do another search from that position, it doesnt.
   I have just a line with the first search result, than I clean the search box 
   and put another code, but I get an error message “Post type not valid” on grey
   sceen and following link: [https://test.sacconicase.com/wp-admin/edit.php?s=14463&post_status=all&post_type=any&_wpnonce=672638b9d7&_wp_http_referer=%2Fwp-admin%2Fedit.php%3Fs%3D14463%26post_status%3Dall%26post_type%3Dpost%26action%3D-1%26m%3D0%26cat%3D0%26author%3D0%26seo_filter%26readability_filter%26layout%3D63f726f5b9e82%26paged%3D1%26action2%3D-1&action=-1&m=0&cat=0&author=0&seo_filter=&readability_filter=&layout=63f726f5b9e82&paged=1&action2=-1](https://test.sacconicase.com/wp-admin/edit.php?s=14463&post_status=all&post_type=any&_wpnonce=672638b9d7&_wp_http_referer=%2Fwp-admin%2Fedit.php%3Fs%3D14463%26post_status%3Dall%26post_type%3Dpost%26action%3D-1%26m%3D0%26cat%3D0%26author%3D0%26seo_filter%26readability_filter%26layout%3D63f726f5b9e82%26paged%3D1%26action2%3D-1&action=-1&m=0&cat=0&author=0&seo_filter=&readability_filter=&layout=63f726f5b9e82&paged=1&action2=-1)
 * Code is post number. What could it be?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fproblem-with-search-by-code-in-admin%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/problem-with-search-by-code-in-admin/#post-17373686)
 * It’s likely because the search results page is the wrong context for your search
   function. A new code submission there is probably going to the wrong place. Check
   the initial, working search form’s action attribute. Is the assigned value an
   URL or is it just “” or “#”? (meaning the current page).
 * Then check the form’s action attribute on the non-working search result page.
   The URL is incorrect, or it’s “” or “#”. In all cases it should instead be the
   URL of the initial working page or whatever its action attribute is if elsewhere.
 * IOW, the form submission needs to go to where it can be properly handled.

Viewing 1 replies (of 1 total)

The topic ‘problem with search by code in admin’ is closed to new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/problem-with-search-by-code-in-admin/#post-17373686)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
