Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Custom Filter using meta_value in wordpress admin list not working

The initial thing that jumps out is that you’re using:

template=default

in the URL, but in the code you are using

if( isset($_GET['_wp_page_template']) && !empty($_GET['_wp_page_template']) ) {

you should be checking:

if( isset($_GET['template']) && !empty($_GET['template']) ) {

Also, don’t forget to sanitize the $_GET as that’s user input and cannot be trusted.

Hope that helps.

Related Posts:

  1. Custom templates not showing up in template dropdown
  2. Conditional tag to check if ‘page.php’ is being used?
  3. A check for if is parent page, if has children, if has grandchildren
  4. WordPress page edit does not save selected template
  5. Set page template automatically based on parent
  6. Is there a default template file for child pages / subpages?
  7. Replace Dashes Before Title in Page List
  8. How to display code if it is not certain pages?
  9. Multiple areas of dynamic content in a page
  10. How do I set and list page_template with wpcli?
  11. How do I modify this page template to show subpage excerpts (not post excerpts)?
  12. Limit number of pages that use a specific template?
  13. How to inject custom url path for page ?
  14. Dynamically Load Styles and Scripts from Theme Functions.php
  15. Is there a way to remove or hide individual pages on the Edit Pages screen?
  16. Add custom admin menu item for pages using a certain template
  17. Different “Text Widgets” in Sidebar on Many Different Pages?
  18. What’s the most minimal way in which a page can be hooked into WP?
  19. How do I create multiple page while active a theme
  20. How to make certain page templates visible to admin only
  21. How to dynamically save a selected option from page “Templates” selectbox?
  22. How to add meta boxes to Pages
  23. Custom page template not working
  24. Dynamically change page that loads
  25. Where is the key _wp_page_template passed?
  26. Create subpage – filter parent pages list
  27. How do I pass data from page content to the underlying PHP template
  28. How do I hide the current page’s title?
  29. Password Protected Page Title
  30. Removing the TinyMCE editor for a given page template
  31. Determine page content based on page parent
  32. Displaying page content in category archive (archive.php)
  33. Missing ‘Page Attributes’ in page edit
  34. Any Ideas for Including “More Tag” with get_pages($args)?
  35. Show Custom Post Type meta boxes only on Page Edit
  36. Could be a namespace conflict (?) with login form and register form on the same page
  37. Custom page template for multiple pages
  38. My custom template page not loading content inside it?
  39. Get parent of current page
  40. How to edit a HTML list in WordPress?
  41. Prevent menu from loading in a page template [duplicate]
  42. Custom page with queries returns 404
  43. How to capture GET argument on static page
  44. JQuery Plugins in WordPress
  45. the_content of template page
  46. Remove comment section from new page
  47. WordPress theme: Add page content to the bottom of the Contact form
  48. Dynamic href link to Contact Page
  49. Create page template with some static contents
  50. Can I change the “Home” text in the menu?
  51. WordPress 3.2 – removed ability to select a page template in the page attributes when adding a new page?
  52. Use same page-mypage.php template for several pages
  53. determine whether content is of type Page or a Post and display accordingly
  54. Avoid pages losing template association on site re-deploy
  55. How do you implement a page template automatically being applied to a page?
  56. How do I edit text displayed on my browser tab?
  57. How to create different template designs for different pages in WordPress [closed]
  58. Different css file not working for the page template I created
  59. require_once not working
  60. Displaying posts on homepage – Template Page
  61. Page templates in subdirectories and auto generator
  62. WordPress Page doesn’t load the template selected
  63. Use page template for custom $_GET content
  64. How to bypass 404 for certain pages/posts?
  65. Authors posts on a author created page
  66. Static Website No Titles But Still Nav
  67. custom page templating in WordPress
  68. page template – undefined structure in source code
  69. Suggestions: Customizable header image and style colors that are different for each page
  70. Odd twitter meta data description on all pages
  71. Update Pages ONLY from Stage to Live (not products)
  72. My pages are using my Index.php and not my page.php
  73. WordPress custom pages in a folder
  74. Create page template
  75. WordPress blog posts template bug [closed]
  76. Adding styles/scripts to specific page
  77. How to detect if some page template has been selected
  78. WordPress form submit to custom page template does not work
  79. Using external DB within wordpress
  80. What’s the best way to manage sections on a page?
  81. WordPress Page All Content In Template Good Or Bad Convention?
  82. How do you assign custom template for Posts page (under Front page displays setting)
  83. Display child pages on homepage template
  84. Content template when adding a new page
  85. custom page or standalone page?
  86. Avada Theme – Display results from a specific category [closed]
  87. How to display time when page is created and edited
  88. Call a function on every wordpress pages only
  89. Specify parent page template
  90. WP Template Hierarchy – Need help choosing the correct templates
  91. how bbPress and buddypress add their own page templates to the page template drop down on the page editing screen
  92. Showing certain page without redirection
  93. Create a new page for each form selection
  94. page wordpress add extra unwanted stuff
  95. link a custom page into menu
  96. Adding a filter to wp_edit_posts_query() to prevent hierarchical display of pages
  97. Load new Posts on Scroll on Page
  98. exclude page element from specific pages
  99. May I know where to edit the tax rate?
  100. Site Library issue
Categories pages Tags filters, page-template, pages, post-meta, post-type
How to display the FAQ Archive page in my menu
Moved my site to new host now getting 404

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress