Jump to content

SeoMaestro


Wanze

Recommended Posts

On 4/5/2020 at 2:09 PM, HerTha said:

Hi @Wanze thanks for this fantastic module!

Is there a way to control how the module's XML sitemap generator handles hidden pages?

Hi @HerTha,

What kind of control do you need exactly? Hidden pages are not excluded from the sitemap by default. Currently, you can either include/exclude hidden pages via SeoMaestro field. Or you can use the following hook to alter sitemap items programatically: https://github.com/wanze/SeoMaestro#___sitemapitems

Cheers

  • Like 1
Link to comment
Share on other sites

Hi @Wanze,

I would also like to know if there is any way to improve the way the sitemap gets generated and the way the frontend its affected in the process.


My website have a few thousands of pages and growing rapidly. with a really powerful server, and constant changes , the sitemap refreshes every hour. 

1. Do you think you can build the sitemap.xml in a less resource intensive way? 

2. For bigger websites with more than 50k pages probably websites will need a sitemapindex and a way to keep the sitemap in this limits. 
 

According to a quick google search the Sitemaps should be no larger than 50MB (52,428,800 bytes) and can contain a maximum of 50,000 URLs.
 

Thanks! 

  • Like 1
Link to comment
Share on other sites

3 hours ago, Wanze said:

What kind of control do you need exactly?

I'd like to exclude all hidden pages - except for a few specific ones (manually selected).

Is there a way how this could be established?

Link to comment
Share on other sites

18 hours ago, B3ta said:

Hi @Wanze,

I would also like to know if there is any way to improve the way the sitemap gets generated and the way the frontend its affected in the process.


My website have a few thousands of pages and growing rapidly. with a really powerful server, and constant changes , the sitemap refreshes every hour. 

1. Do you think you can build the sitemap.xml in a less resource intensive way? 

2. For bigger websites with more than 50k pages probably websites will need a sitemapindex and a way to keep the sitemap in this limits. 
 

According to a quick google search the Sitemaps should be no larger than 50MB (52,428,800 bytes) and can contain a maximum of 50,000 URLs.
 

Thanks! 

Hi @B3ta,

The sitemap generation should not affect your frontend; the sitemap should only be generated on requests where a user is logged into the admin: https://github.com/wanze/SeoMaestro/blob/master/SeoMaestro.module.php#L154

1. If the performance is a problem on sites with a large amount of pages, I suggest to disable the automatic generation and to create the sitemap manually via cronjobs. You'd need a CLI script that bootstraps ProcessWire and then executes $wire->module('SeoMaestro')->getSitemapManager()->generate().

2. I would be happy to support multiple sitemaps, but I do not have any time/capacity at the moment, nor am I working with ProcessWire anymore. If anyone would like to contribute this, please send a pull request!

Cheers

Link to comment
Share on other sites

15 hours ago, HerTha said:

I'd like to exclude all hidden pages - except for a few specific ones (manually selected).

Is there a way how this could be established?

You have the following possibilities:

  • Manually include/exclude all pages via SeoMaestro field
  • Setup the default value on template level to not include pages in the sitemap, and then manually include them via SeoMaestro field. Or vice versa, whatever makes more sense 🙂
  • If you know how to use hooks: Exclude the hidden pages by using the hook mentioned in my first answer

Cheers

  • Like 1
Link to comment
Share on other sites

Okay, I understand there is no simple toggle/option to exclude/include hidden files, so I will have a closer look at hooks then.

Thank you so much for the time you are dedicating to maintain this module and to answering (my) questions!

  • Like 1
Link to comment
Share on other sites

5 hours ago, HerTha said:

Okay, I understand there is no simple toggle/option to exclude/include hidden files, so I will have a closer look at hooks then.

Thank you so much for the time you are dedicating to maintain this module and to answering (my) questions!

You're welcome! 🙂Let me know if you need any help in implementing a solution using hooks. Maybe the following examples from the tests could be useful : https://github.com/wanze/SeoMaestro/blob/master/tests/src/SitemapManagerTest.php#L177-L220

Cheers

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 4 weeks later...

Hello @Wanze
thanks for the great Plugin. I am Using a template with segments. Im able to overwrite the canonical url just like i needed. But in og:url i cannot overwrite when i try it like this:

page()->seo->og->url = $canonical;

am i doing something wrong? the url field seemingly is not part of the changeable fields but just generated. i think in this case canonical should be used when it is overwritten (like in this case i overwrite canonical before og:url

thank you for your feedback 🙂

Link to comment
Share on other sites

On 4/15/2020 at 2:31 PM, 3fingers said:

[Litte OT]

@Wanze Out of curiosity, has something changed in your development arsenal? 🙂

Hi @3fingers

Yes and no 🙂 I used ProcessWire for some projects as freelancer, but never at my "daily" work. I still believe that ProcessWire is a great open source software and I'm maintaining a couple of private projects. But in my opinion, ProcessWire lacks of some important features (testing, config management, migration handling, command line tools, extensible frontend etc.) and also it is not easy to setup if multiple people are working on the same project. Nowadays I am writing Flutter apps and Javascript. But of course I still come back here to give some support and to see how ProcessWire evolves! 🙂

Cheers

  • Like 1
Link to comment
Share on other sites

On 5/8/2020 at 1:44 PM, csaggo.com said:

Hello @Wanze
thanks for the great Plugin. I am Using a template with segments. Im able to overwrite the canonical url just like i needed. But in og:url i cannot overwrite when i try it like this:

page()->seo->og->url = $canonical;

am i doing something wrong? the url field seemingly is not part of the changeable fields but just generated. i think in this case canonical should be used when it is overwritten (like in this case i overwrite canonical before og:url

thank you for your feedback 🙂

Hi @csaggo.com

It seems like there is no url field for opengraph tags. At the moment, the og url is generated dynamically based on the page's httpUrl, so you cannot change it at runtime. If the module would use the canonical url at render time, it should work. Can you open an issue on GitHub? 🙂

Cheers

  • Like 1
Link to comment
Share on other sites

Hello, 
i tried to install this module. (currently MarkupSeo in USE)
created a  TV called   $seom  applied to home template and basci page to test. 

Maybe how to define the meta tags values ? Can i use the current tags from MarkupSeo or for example i want to use the summary as description. 

in the sitemap i see only one entry with the home template. 
The basic pages are not shown. Have I to set something specially ? 

 

Thanks 

 

Link to comment
Share on other sites

I'd need to change the base url for the alternate link meta tags. Is it true that you can neither work with different domains for multiple languages nor deactivate that functionality to do it yourself?

Link to comment
Share on other sites

Hi, I'm getting apostrophe's being rendered as HTML in the Maestro Output. 
What is the best recommended way to fix this?

<meta name="description" content="Greg&apos;s wedding photography  is fun, creative and natural. Capturing moments when know he&apos;s there. He makes you feel comfortable and his enthusiasm is infectious.">



Thank you. 

Link to comment
Share on other sites

On 5/17/2020 at 2:51 PM, uiui said:

I'd need to change the base url for the alternate link meta tags. Is it true that you can neither work with different domains for multiple languages nor deactivate that functionality to do it yourself?

To anyone else who runs into this issue: I solved it with a hook like this:

$wire->addHookAfter('SeoMaestro::renderMetatags', function (HookEvent $event) { 
	$tags = $event->arguments(0); 
	$group = $event->arguments(1); 
	if ($group === null) {
        foreach(wire("languages") as $lang) {
            $code = $lang->name;//$lang->isDefault() ? $defaultLang : $lang->name;
            $tags["link_rel_{$code}"] = preg_replace("/domain.tld/", $lang->domain, $tags["link_rel_{$code}"]);
        }

        $event->return = $tags; 
	} 
});

$lang->domain stores the domain used for a language.

  • Like 1
Link to comment
Share on other sites

I want to replace domain names in my sitemap of a multi-language, multi-domain site. I tried registering a hook in _init.php but it seems like this is not how to do this.

Where do I need to register a hook for SeoMaestro::sitemapItems?

 

Edit: I eventually solved this issue. As the sitemap is only created when requesting an admin page, the webhook needs to be registered in admin.php.

$wire->addHookAfter('SeoMaestro::sitemapItems', function (HookEvent $event) {
    $sitemapItems = $event->arguments(0);
    
    foreach($sitemapItems as $item) {
        $alternates = $item->get('alternates');
        foreach(wire("languages") as $lang) {
            $code = $lang->name;
            if($alternates[$code]) {
                $alternates[$code] = preg_replace("/(?:local\.)domain\.tld/",
                    $lang->domain, $alternates[$code]);
            }
        }
        $item->set('alternates', $alternates);
    }
    $event->return = $sitemapItems;
});

The domain for each language is stored in $lang->domain.

Link to comment
Share on other sites

  • 2 weeks later...

Hello, 

some of my sites have the Image TV called {images} and some {immo_images} if i try to define the basic value like 

{images} {immo_images} it doesnt work. for images. 

For descriprion is no problem but how i can solve this for images in open graph ? 

Thanks. 

Link to comment
Share on other sites

  • 2 weeks later...
On 6/4/2020 at 5:49 AM, iNoize said:

Hello, 

some of my sites have the Image TV called {images} and some {immo_images} if i try to define the basic value like 

{images} {immo_images} it doesnt work. for images. 

For descriprion is no problem but how i can solve this for images in open graph ? 

Thanks. 

Hi @iNoize

It should work, here's a quote from the readme:

Quote

The opengraph image tag supports placeholders as well: Simply reference an image field. If the field is holding multiple images, the first one is used. For example, {images} would pick the first image from the images field.

However, you can only use one field as placeholder for the Opengraph image, so either {images} or {immo_images}. Hope that helps!

Cheers

Link to comment
Share on other sites

46 minutes ago, Wanze said:

Hi @iNoize

It should work, here's a quote from the readme:

However, you can only use one field as placeholder for the Opengraph image, so either {images} or {immo_images}. Hope that helps!

Cheers

OK thanks, it means I have to set manually for each document where the images fiels is called immo_images. 

This Module don't check also for the TV value. Example if images is empty use the next one placeholder from main config

Link to comment
Share on other sites

On 6/12/2020 at 9:26 PM, iNoize said:

OK thanks, it means I have to set manually for each document where the images fiels is called immo_images. 

This Module don't check also for the TV value. Example if images is empty use the next one placeholder from main config

You can setup the default values for each template and pages using that template will inherit the configured placeholder by default, unless overridden on page-level. 

For your second question: No, there is no such fallback implemented. You would need to programmatically add that logic yourself by using hooks.

Link to comment
Share on other sites

Hello, 
how to set the values to "Inherit defaukt value"  via API ? With some tests i have now the Title is empty in the $page->seom->title. 
e.G. here https://prnt.sc/t2r1vr


I have something like this.   $seom is my SeoMaestro TV 

$seiten = $pages->find("template=basic-page,  include=hidden");
 foreach ($seiten as $p) {
     $p->of(false);
       if ($p->seo_title != '') {
        $p->seom->meta->title = $p->seo_title;
       }else {
       $p->seom->meta->title = $p->title;
   }
  $pages->save($p); 

 }

but it does not work for me.  I need to set it to default Value if its possible ? 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...