Jump to content
Wanze

SeoMaestro

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

Share this post


Link to post
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

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites
3 hours ago, B3ta said:

websites with more than 50k pages

wow, what is that? 📈

Share this post


Link to post
Share on other sites
1 minute ago, HerTha said:

wow, what is that? 📈

It's a classifieds website.

Share this post


Link to post
Share on other sites
2 minutes ago, B3ta said:

It's a classifieds website.

I guess I need to grow up before taking on such tasks! 🙃

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Quote

...nor am I working with ProcessWire anymore.

[Litte OT]

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

  • Like 4

Share this post


Link to post
Share on other sites

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 🙂

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Posted (edited)
10 hours ago, Wanze said:

Flutter apps

Great!

This is where I make noise about Flutter. Would be nice to hear you talk about your experiences there 😄

 

 

Edited by kongondo
  • Like 1

Share this post


Link to post
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 

 

Share this post


Link to post
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?

Share this post


Link to post
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. 

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
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...