Post Indexer doesn't like my custom post types

I have created two custom post types (via CustomPress) in one subsite of my multisite network. I want Post Indexer to index them for Global Site Search.

The subsite is /members

I go to Network >> Sites and under the "Indexing" column, I select "Edit" and use the checkboxes to choose my custom post types: member_page and parent_membership, and uncheck pages and posts. Click Save Changes.

Now there are no post types listed under the Indexing column at all. I go back to Edit, and all boxes are unchecked. I re-checked "page" (post is gone now??) but after saving changes, there is still nothing checked.

I am able to select incsub_events, which is a custom post type. But not the ones I created with CustomPress.

Did I do something wrong in setting up the post types?

  • Adam Czajczyk

    Hello kalico,

    I hope you're well today and thank you for your question!

    To make Post Indexer include these posts you will want to take care of following:

    1. Make sure that the sites containing these posts are public

    This means that the "Public" attribute is set on "Network Admin -> Sites -> [Edit]" page for each of these sites. This is because Post Indexer cannot index any content from non-public sites.

    2. Please go to the "Network Admin -> Post Indexer -> Global Settings" page and put your custom post types in "Default Post Types" text box (and "Update Settings":wink:. For example: one of your post types is "member_page" so the content of the "Default Post Types" box would be as shown on a screenshot below.

    You will want to add all your custom post types there the same way and then use "Rebuild Index" option.

    I hope that helps!

    Best regards,
    Adam

  • kalico

    Hi Adam,

    Thank you for getting back to me. The site is public, so that part is ok. I am trying what you suggested on the Global Settings page, and I will report back after indexing is complete.

    However, I did notice that other post types (from plugins, not from CustomPress) which I set manually on the Sites page are being indexed expected, without being set in global settings.

    Case in point: the screenshot shows that the post type "forum" (from bbPress) was indexed, and I did not put it on the global settings tab -- I only checked the box on one of the subsites.

    I'll report back again after re-indexing is complete.

  • kalico

    Adam Czajczyk

    It's been 3.5 hours since I started the rebuild. All the sites are complete except for one....and it's the /members site, which has the two custom post types. It's been sitting at 1 site to index for the past hour (so 5 much larger sites were indexed in 2.5 hours, and it's been an hour for the last site. It only has 3 posts in those two types, so I doubt it's a problem with too much data to index.

    Not sure what to do at this point. Support access is open if you want to take a look around.

  • kalico

    Hi Predrag Dubajic

    Thanks for the idea. Most of my sites have the same maintenance mode plugin active. They are all being indexed just fine.

    This site is essentially an exactly replica (plugins and all) of the Resources subsite, which is being indexed properly. I used the Cloner plugin to create it, and just enabled CustomPress additionally.

    I will try taking down all other plugins (except network active ones, since those aren't causing trouble anywhere else on the network) and see what happens. I think I will also try making a custom post type on another subsite and see if it gets indexed.

  • kalico

    I decided to create another custom post type first, to see if it would be indexed on a site that is otherwise indexing just fine.

    I made a post type called test_indexing on the subsite /testevents.

    Then I went to Network >> Sites (to see if I could replicate my original experience).

    Under the Indexing column, I click on "Edit" and there is a checkbox for test_indexing. I tick the box, save changes, but the changes don't stick. I open the Edit modal again, and the checkbox is un-ticked. Same experience as I had initially.

    SIDE NOTE: Interestingly, two of the sites (not all of them) where my custom post types do not exist, have them listed under Indexing now (presumably due to the default global setting I added per Adam's instruction). Not surprisingly, there is no checkbox available for that custom post type (because it doesn't exist). I've attached screenshots, but did not display them so they do not distract from the real/original issue. But they may help shed some light.

  • Adam Czajczyk

    Hello Kalico!

    I run some more tests on my own setup and I was able to replicate the same issue on my own setup. After some further "digging" I think this is related to how the custom post types are created on MultiSite by CustomPress.

    The CustomPress is enabled on your setup on "site-by-site" base and for some reason this seems to be preventing Post Indexer from indexing them. On my test setup I switched it to "network enabled" and then I was able to index all custom posts with no issues whatsoever.

    Switching to "network enabled" would however remove already registered custom post types so it would be necessary to re-create them. There is a workaround though:

    1. use WP export tool to export all necessary custom content to XML file
    2. use CustomPress Import/Export tool to export custom post types, custom taxonomies etc; this tool produces a code instead of files so you will want to copy that code to some temporary .txt file in order to be able to use it later
    3. disable CustomPress on all sub-sites
    4. network-enable CustomPress
    5. on "Network Admin -> CustomPress -> Settings" page make sure that "Enable sub-site content" types is enabled (both check boxes)
    6. go to selected sub-sites and import your custom content types there (via sub-sites where they belong, not via "Network admin")
    7. using WP import tools import the content back to the site

    Since custom post types' names are already added to your Post Indexer and they won't change, re-building index should now include all those posts.

    Best regards,
    Adam

  • kalico

    Finally had time to get back to this today. The process of exporting and changing to network activation is complete. Everything seems to be in order :slight_smile: Now I'm just waiting for the reindexing.

    I do want to mention that the content export/import seems to have been unnecessary. It actually tried to create duplicates. I think this would have been useful if I was importing into a site that did not have the content in it in the first place.

    In any case, it all seems to be working fine. I'll report back tomorrow, when indexing is complete.

  • kalico

    Hi Adam Czajczyk Ok, changes were made and indexing is complete. But.....no joy. Here are my observations:

    1) The first thing I noticed is that at Network >> Settings >> Post Indexer there are no pretty graphs anymore. I actually noticed this before I ran the global rebuild, but hoped it would straighten itself out. It did not.

    2) The statistics on the main tab of Post Indexer do not show that my custom post types are being indexed at all, even though they are in the list of post types on the default settings tab.

    3) These two search terms get no results, but there are custom posts that have these words on them:
    http://june.nrocnetwork.org/site-search/?phrase=chesapeake
    http://june.nrocnetwork.org/site-search/?phrase=okoboji

    These are fictional schools :wink: but they have real pages in my site that should be indexed:
    http://june.nrocnetwork.org/members/profile/chesapeake-bay-university/
    http://june.nrocnetwork.org/members/profile/university-of-okoboji/

    Proof that the search functionality is working across all sites in the network can be seen by using the search term "algebra":
    http://june.nrocnetwork.org/site-search/?phrase=algebra

    The results of this search are coming from all across the network (/resources and /nroc are blogs, and /membership is a page on the primary site of the network).

    4) On Network >> Sites the problem I ran into initially still stands:

    a) the custom post types are only showing up for sites that do not utilize them
    b) when I try to edit the list of indexed post types for the site that does have content in them (/members) the settings won't "stick" (I can't help but wonder if this is more of a problem with the modal window than the Post Indexer....?)

    Two steps forward, three steps back, unfortunately.... :slight_frown:

  • Adam Czajczyk

    Hello Kalico!

    Thank you for getting back to me with these information. I admit I'm a bit surprised as this worked like a charm for me. It seems though that the case is more complex than this :slight_frown:

    That said, I feel it's time to ask our Second Line Support guys for help on this one. I hope they'll be able to lend us a helping hand and find the reason/solution for the issue. However, they might need to access your site directly in order to check its settings, files and/or database. To let them do this, please send in:

    Subject: "Attn: Adam Czajczyk"

    - Mark to my attention, the subject line should contain only: ATTN: Adam Czajczyk
    - Do not include anything else in the subject line, doing so may delay our response due to how email filtering works.
    - Link back to this thread
    - login URL and admin account login credentials (may be a temporary admin account) data
    - Include FTP log-in details (hostname, username & password)
    - Include hosting control panel access details (login address, username & password)
    -- cPanel's usually the control panel used for this, but your provider may use something else; I'll need this for accessing your site's database, preferably via phpMyAdmin
    - Include any relevant URLs for your site

    Please use our contact form here http://premium.wpmudev.org/contact/.
    Select "I have a different question" from the drop-down list.

    Please be sure to make a full backup of your entire site first!

    Best regards,
    Adam

  • kalico

    Hi Adam Czajczyk

    I apologize for the slow response. Setting up a new user on our server is not as simple as with a cPanel host, because we have higher security measures in place via AWS (and no control panel at all -- just straight SSH through terminal, or SFTP via a client). I have to go through my IT department to get you access, and I have to know your public IP address so we can allow it through the SSH port. I am looking for a way on my side to streamline that process.

    In the meantime, I wanted to let you know that there have been some developments around Post Indexer that might be related.

    Please see the most recent posts in these threads:
    - Ash discovers that E+ issues are actually rooted in Post Indexer and provides code to fix, then....
    - problems with admin bar association on network-wide E+ shortcodes are magically fixed after seemingly unrelated code change to Post Indexer.

    Unfortunately, the CustomPress problem has not resolved magically. But I figure there might be some clues here to what's happening.

    I thought you might want to know about those things and confer with your fellow Superheroes before looking at my site. I'll still be working on getting that access, though. :slight_smile: Just let me know if anything new crops up in the mean time. Thanks :slight_smile:

  • Adam Czajczyk

    Hello Kalico!

    It seems that these issue may indeed be related. Events+ make use of custom posts as well. The difference is that those are "hard-coded"/created by the plugin automatically but still - they are custom type posts. I have already contacted Ash for consultation and hopefully we'll be able to work that out together then.

    As for access. Please take your time, security measures are surely most important and I can wait for credentials as long as you need to handle this :slight_smile: When you're ready just send me a message please and after I talk to Ash I'll update this thread.

    Best regards,
    Adam

  • Chloe

    Not to hijack a thread, but I'm having the exact same issue as Kalico. I've got a custom post type (NOT made with custompress) that post indexer refuses to recognize. No matter what settings I change, or if I rebuild the index, the custom post type never sticks!
    I've added my post type to my index's defaults as well as to the SITES > POST INDEXER SETTINGS checkboxes but to no avail. Every time I click save changes, it'll save the state of every checkbox except the custom post type.

    My system's a little simpler to access/easier to set up a new user on my server, so I dunno if you want to take a look in there while waiting on Kalico. If not, I can open up a new ticket. I really just wanted to let you guys know that something is definitely off with the custom post type post indexer.

  • kalico

    Hey Chloe - Welcome to the WPMUDEV community! I hope you did open a thread of your own. The WPMUDEV team is awesome and will definitely take care of you.

    Just so you know, I've already sent Adam a message, and I'm just waiting for him to get back to me, so that process has been started. I'm anxious to get this working too, but these guys have a lot going on....and when they produce an update based on our feedback, it's always worth the wait! :slight_smile:

  • kalico

    Sorry to trouble y'all, but considering where we left off on the other thread here I'm not sure if you guys are waiting on me for something, or if I'm waiting on you :slight_smile: I was going to get Adam Czajczyk set up to access my site, but then it turned out that he was talking to Ash ....and now I've lost track of where things stand.

    If you still need SFTP access, please let me know.

    Thanks!

  • Milan

    Hello kalico

    Hope you are well today. :slight_smile:

    No, you have not missed anything. We are talking with Ash for your that issue. For now, I've pinged Adam too to get some more insights and updates. Whenever there will be some update for your that recurring event issue, we will surely update you there. :slight_smile:

    And its always best to ask for update on same thread. :slight_smile: This way we can ensure we are keeping our communication separate and centered.

    Hope this helps. :slight_smile:
    Best Regards,
    Milan

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.